21 #ifndef PCMANFM_DESKTOPWINDOW_H
22 #define PCMANFM_DESKTOPWINDOW_H
26 #include <unordered_map>
34 #include <libfm-qt/core/folder.h>
37 class CachedFolderModel;
38 class ProxyFolderModel;
39 class FolderViewListView;
63 void setForeground(
const QColor& color);
64 void setShadow(
const QColor& color);
65 void setBackground(
const QColor& color);
66 void setDesktopFolder();
67 void setWallpaperFile(QString filename);
68 void setWallpaperMode(WallpaperMode mode = WallpaperStretch);
69 void setLastSlide(QString filename);
70 void setWallpaperDir(QString dirname);
71 void setSlideShowInterval(
int interval);
72 void setWallpaperRandomize(
bool randomize);
75 void updateWallpaper();
78 void updateFromSettings(
Settings& settings,
bool changeSlide =
true);
80 void queueRelayout(
int delay = 0);
82 void saveItemPositions();
84 int screenNum()
const {
88 void setScreenNum(
int num);
90 QScreen* getDesktopScreen()
const;
93 virtual void prepareFolderMenu(Fm::FolderMenu* menu)
override;
94 virtual void prepareFileMenu(Fm::FileMenu* menu)
override;
95 virtual void resizeEvent(QResizeEvent* event)
override;
96 virtual void onFileClicked(
int type,
const std::shared_ptr<const Fm::FileInfo>& fileInfo)
override;
98 void loadItemPositions();
99 void retrieveCustomPos();
100 void storeCustomPos();
102 QImage loadWallpaperFile(QSize requiredSize);
104 virtual bool event(QEvent* event)
override;
105 virtual bool eventFilter(QObject* watched, QEvent* event)
override;
107 virtual void childDragMoveEvent(QDragMoveEvent* e)
override;
108 virtual void childDropEvent(QDropEvent* e)
override;
109 virtual void closeEvent(QCloseEvent* event)
override;
110 virtual void paintEvent(QPaintEvent* event)
override;
113 void onDesktopPreferences();
114 void onCreatingShortcut();
116 void toggleDesktop();
118 void onRowsAboutToBeRemoved(
const QModelIndex& parent,
int start,
int end);
119 void onRowsInserted(
const QModelIndex& parent,
int start,
int end);
120 void onLayoutChanged();
121 void onModelSortFilterChanged();
122 void onFolderStartLoading();
123 void onFolderFinishLoading();
124 void onFilesAdded(
const Fm::FileInfoList files);
126 void relayoutItems();
127 void onStickToCurrentPos(
bool toggled);
132 void onCutActivated();
133 void onCopyActivated();
134 void onCopyFullPathActivated();
135 void onPasteActivated();
136 void onRenameActivated();
137 void onBulkRenameActivated();
138 void onDeleteActivated();
139 void onFilePropertiesActivated();
141 void updateTrashIcon();
143 void onInlineRenaming(
const QString& oldName,
const QString& newName);
146 void removeBottomGap();
147 void addDesktopActions(QMenu* menu);
148 void paintBackground(QPaintEvent* event);
149 void paintDropIndicator();
150 bool stickToPosition(
const std::string& file, QPoint& pos,
const QRect& workArea,
const QSize& grid,
bool reachedLastCell =
false);
151 static void alignToGrid(QPoint& pos,
const QPoint& topLeft,
const QSize& grid,
const int spacing);
153 void updateShortcutsFromSettings(
Settings& settings);
154 void createTrashShortcut(
int items);
155 void createHomeShortcut();
156 void createComputerShortcut();
157 void createNetworkShortcut();
160 static void onTrashChanged(GFileMonitor* monitor, GFile* gf, GFile* other, GFileMonitorEvent evt,
DesktopWindow* pThis);
161 void trustOurDesktopShortcut(std::shared_ptr<const Fm::FileInfo> file);
162 bool isTrashCan(std::shared_ptr<const Fm::FileInfo> file)
const;
164 QImage getWallpaperImage()
const;
166 QModelIndex navigateWithKey(
int key, Qt::KeyboardModifiers modifiers,
const QModelIndex& start = QModelIndex());
168 QModelIndex indexForPos(
bool* isTrash,
const QPoint& pos,
const QRect& workArea,
const QSize& grid)
const;
171 Fm::ProxyFolderModel* proxyModel_;
172 Fm::FolderModel* model_;
173 std::shared_ptr<Fm::Folder> folder_;
174 Fm::FolderViewListView* listView_;
179 QString wallpaperFile_;
180 WallpaperMode wallpaperMode_;
182 QString wallpaperDir_;
183 int slideShowInterval_;
184 QTimer* wallpaperTimer_;
185 bool wallpaperRandomize_;
186 QPixmap wallpaperPixmap_;
188 bool desktopHideItems_;
191 std::unordered_map<std::string, QPoint> customItemPos_;
192 std::unordered_map<std::string, QPoint> customPosStorage_;
193 QTimer* relayoutTimer_;
194 QTimer* selectionTimer_;
198 QTimer* trashUpdateTimer_;
199 GFileMonitor* trashMonitor_;
201 QStringList filesToTrust_;
Definition: application.h:56
Definition: desktopwindow.h:46
Definition: launcher.h:30
Definition: settings.h:154