Sayonara Player
DirectoryContextMenu.h
1 /* DirectoryContextMenu.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras)
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef DIRECTORYCONTEXTMENU_H
22 #define DIRECTORYCONTEXTMENU_H
23 
24 #include "Gui/Utils/ContextMenu/LibraryContextMenu.h"
25 
27 
28 namespace Directory
29 {
34  class ContextMenu :
36  {
37  Q_OBJECT
38  PIMPL(ContextMenu)
39 
40  signals:
41  void sigCreateDirectoryClicked();
42  void sigRenameClicked();
43  void sigRenameByTagClicked();
44  void sigCollapseAllClicked();
45  void sigViewInFileManagerClicked();
46  void sigMoveToLibrary(LibraryId id);
47  void sigCopyToLibrary(LibraryId id);
48 
49  public:
50  enum Mode
51  {
52  Dir=0,
53  File
54  };
55 
56  enum Entry
57  {
58  EntryCreateDir = Library::ContextMenu::EntryLast,
59  EntryRename = Library::ContextMenu::EntryLast << 1,
60  EntryRenameByTag = Library::ContextMenu::EntryLast << 2,
61  EntryCollapseAll = Library::ContextMenu::EntryLast << 3,
62  EntryMoveToLib = Library::ContextMenu::EntryLast << 4,
63  EntryCopyToLib = Library::ContextMenu::EntryLast << 5,
64  EntryViewInFM = Library::ContextMenu::EntryLast << 6
65  };
66 
67  ContextMenu(Mode mode, LibraryInfoAccessor* libraryInfoAccessor, QWidget* parent);
68  ~ContextMenu() override;
69 
70  void refresh(int count=0);
71 
72  ContextMenu::Entries entries() const override;
73  void showActions(ContextMenu::Entries entries) override;
74  void showDirectoryAction(ContextMenu::Entry entry, bool b);
75 
76  private slots:
77  void libraryMoveActionTriggered();
78  void libraryCopyActionTriggered();
79 
80  protected:
81  void languageChanged() override;
82  void skinChanged() override;
83  };
84 }
85 
86 #endif // DIRECTORYCONTEXTMENU_H
The DirectoryContextMenu class.
Definition: DirectoryContextMenu.h:36
void showActions(ContextMenu::Entries entries) override
show a specific amount of Entries
ContextMenu::Entries entries() const override
get all visible entries
Definition: LibraryInfoAccessor.h:36
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:45