diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-01-21 23:51:08 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-04 03:33:21 -0500 |
| commit | d0be8a0d3b8c021e3efda0041ebb55eae25dbfde (patch) | |
| tree | 8c0ca298d7c83578441597f23be87056cf329768 /src/envshell.h | |
| parent | e3211683fd75b4c297f2f670819ad5dacb18a19c (diff) | |
ShellMenu class
Diffstat (limited to 'src/envshell.h')
| -rw-r--r-- | src/envshell.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/envshell.h b/src/envshell.h index 3be53841..3e694562 100644 --- a/src/envshell.h +++ b/src/envshell.h @@ -1,18 +1,34 @@ #ifndef ENV_SHELL_H #define ENV_SHELL_H +#include "env.h" #include <QFileInfo> #include <QPoint> namespace env { -void showShellMenu( - QWidget* parent, const QFileInfo& file, const QPoint& pos); +class ShellMenu +{ +public: + void addFile(QFileInfo fi); + void exec(QWidget* parent, const QPoint& pos); + +private: + std::vector<QFileInfo> m_files; -void showShellMenu( - QWidget* parent, const std::vector<QFileInfo>& files, const QPoint& pos); + QMainWindow* getMainWindow(QWidget* w); + COMPtr<IShellItem> createShellItem(const std::wstring& path); + COMPtr<IPersistIDList> getPersistIDList(IShellItem* item); + CoTaskMemPtr<LPITEMIDLIST> getIDList(IPersistIDList* pidlist); + std::vector<LPCITEMIDLIST> createIdls(const std::vector<QFileInfo>& files); + COMPtr<IShellItemArray> createItemArray(std::vector<LPCITEMIDLIST>& idls); + COMPtr<IContextMenu> createContextMenu(IShellItemArray* array); + HMenuPtr createMenu(IContextMenu* cm); + int runMenu(QMainWindow* mw, IContextMenu* cm, HMENU menu, const QPoint& p); + void invoke(QMainWindow* mw, const QPoint& p, int cmd, IContextMenu* cm); +}; -} +} // namespace #endif // ENV_SHELL_H |
