digiKam
wallpaperplugin.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2019-04-02
7  * Description : plugin to export image as wallpaper
8  *
9  * Copyright (C) 2019 by Igor Antropov <antropovi at yahoo dot com>
10  * Copyright (C) 2019-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_WALLPAPER_PLUGIN_H
25 #define DIGIKAM_WALLPAPER_PLUGIN_H
26 
27 // Qt includes
28 
29 #include <QString>
30 #include <QIcon>
31 #include <QList>
32 
33 // Local includes
34 
35 #include "dplugingeneric.h"
36 
37 #define DPLUGIN_IID "org.kde.digikam.plugin.generic.Wallpaper"
38 
39 using namespace Digikam;
40 
42 {
43 
45 {
46  Q_OBJECT
47  Q_PLUGIN_METADATA(IID DPLUGIN_IID)
48  Q_INTERFACES(Digikam::DPluginGeneric)
49 
50 public:
51 
56  {
57  Adjusted = 0,
58  AdjustedAspectRatio = 1,
59  AdjustedCropped = 2,
60  Mosaic = 3,
61  Centered = 6
62  };
63 
64 public:
65 
66  explicit WallpaperPlugin(QObject* const parent = nullptr);
67  ~WallpaperPlugin() override;
68 
69  QString name() const override;
70  QString iid() const override;
71  QIcon icon() const override;
72  QString details() const override;
73  QString description() const override;
74  QList<DPluginAuthor> authors() const override;
75 
76  void setup(QObject* const) override;
77 
78 private Q_SLOTS:
79 
80  void slotWallpaper();
81 
82 private:
83 
84  bool setWallpaper(const QString& path, int layout = AdjustedCropped) const;
85 };
86 
87 } // namespace DigikamGenericWallpaperPlugin
88 
89 #endif // DIGIKAM_WALLPAPER_PLUGIN_H
Definition: wallpaperplugin.h:45
WallpaperLayout
Definition: wallpaperplugin.h:56
Definition: dplugingeneric.h:42
Definition: piwigotalker.h:48
Definition: wallpaperplugin.cpp:40
Definition: datefolderview.cpp:43
#define DPLUGIN_IID
Definition: wallpaperplugin.h:37