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 
26 namespace Directory
27 {
32  class ContextMenu :
34  {
35  Q_OBJECT
36  PIMPL(ContextMenu)
37 
38  signals:
39  void sigCreateDirectoryClicked();
40  void sigRenameClicked();
41  void sigRenameByTagClicked();
42  void sigCollapseAllClicked();
43  void sigViewInFileManagerClicked();
44  void sigMoveToLibrary(LibraryId id);
45  void sigCopyToLibrary(LibraryId id);
46 
47  public:
48  enum Mode
49  {
50  Dir=0,
51  File
52  };
53 
54  enum Entry
55  {
56  EntryCreateDir = Library::ContextMenu::EntryLast,
57  EntryRename = Library::ContextMenu::EntryLast << 1,
58  EntryRenameByTag = Library::ContextMenu::EntryLast << 2,
59  EntryCollapseAll = Library::ContextMenu::EntryLast << 3,
60  EntryMoveToLib = Library::ContextMenu::EntryLast << 4,
61  EntryCopyToLib = Library::ContextMenu::EntryLast << 5,
62  EntryViewInFM = Library::ContextMenu::EntryLast << 6
63  };
64 
65  ContextMenu(Mode mode, QWidget* parent);
66  ~ContextMenu() override;
67 
68  void refresh(int count=0);
69 
70  ContextMenu::Entries entries() const override;
71  void showActions(ContextMenu::Entries entries) override;
72  void showDirectoryAction(ContextMenu::Entry entry, bool b);
73 
74  private slots:
75  void libraryMoveActionTriggered();
76  void libraryCopyActionTriggered();
77 
78  protected:
79  void languageChanged() override;
80  void skinChanged() override;
81  };
82 }
83 
84 #endif // DIRECTORYCONTEXTMENU_H
Directory::ContextMenu
The DirectoryContextMenu class.
Definition: DirectoryContextMenu.h:34
Directory::ContextMenu::entries
ContextMenu::Entries entries() const override
get all visible entries
Directory::ContextMenu::showActions
void showActions(ContextMenu::Entries entries) override
show a specific amount of Entries
Library::ContextMenu
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:45