digiKam
previewtoolbar.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 : 2010-01-10
7  * Description : a tool bar for preview mode
8  *
9  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * 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_PREVIEW_TOOL_BAR_H
25 #define DIGIKAM_PREVIEW_TOOL_BAR_H
26 
27 // Qt includes
28 
29 #include <QWidget>
30 #include <QAction>
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 
36 class KConfigGroup;
37 
38 namespace Digikam
39 {
40 
41 class EditorWindow;
42 
43 class DIGIKAM_EXPORT PreviewToolBar : public QWidget
44 {
45  Q_OBJECT
46 
47 public:
48 
50  {
51  PreviewOriginalImage = 0x00000001,
52  PreviewBothImagesHorz = 0x00000002,
53  PreviewBothImagesVert = 0x00000004,
54  PreviewBothImagesHorzCont = 0x00000008,
55  PreviewBothImagesVertCont = 0x00000010,
56  PreviewTargetImage = 0x00000020,
57  PreviewToggleOnMouseOver = 0x00000040,
58  NoPreviewMode = 0x00000080,
59 
60  AllPreviewModes = PreviewOriginalImage | PreviewBothImagesHorz |
61  PreviewBothImagesVert | PreviewBothImagesHorzCont |
62  PreviewBothImagesVertCont | PreviewTargetImage |
63  PreviewToggleOnMouseOver,
64 
65  UnSplitPreviewModes = PreviewOriginalImage | PreviewTargetImage | PreviewToggleOnMouseOver
66  };
67 
68 public:
69 
70  explicit PreviewToolBar(QWidget* const parent = nullptr);
71  ~PreviewToolBar() override;
72 
73  void setPreviewModeMask(int mask);
74 
75  void setPreviewMode(PreviewMode mode);
76  PreviewMode previewMode() const;
77 
78  void readSettings(KConfigGroup& group);
79  void writeSettings(KConfigGroup& group);
80 
81  void registerMenuActionGroup(EditorWindow* const editor);
82 
83 Q_SIGNALS:
84 
86 
87 private Q_SLOTS:
88 
89  void slotButtonReleased(int);
90  void slotActionTriggered(QAction*);
91 
92 private:
93 
94  void setCheckedAction(int id);
95 
96 private:
97 
98  class Private;
99  Private* const d;
100 };
101 
102 } // namespace Digikam
103 
104 #endif // DIGIKAM_PREVIEW_TOOL_BAR_H
Definition: editorwindow.h:78
Definition: previewtoolbar.h:44
PreviewMode
Definition: previewtoolbar.h:50
void signalPreviewModeChanged(int)
Definition: datefolderview.cpp:43