blob: 86d9b0fcbe4ca9e97b2b8eb3f725be33e33c2664 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#ifndef ENV_SHELL_H
#define ENV_SHELL_H
#include "env.h"
#include <QFileInfo>
#include <QPoint>
namespace env
{
class ShellMenu
{
public:
void addFile(QFileInfo fi);
void exec(QWidget* parent, const QPoint& pos);
private:
std::vector<QFileInfo> m_files;
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);
void showDummyMenu(QMainWindow* mw, const QPoint& pos, const QString& what);
};
} // namespace
#endif // ENV_SHELL_H
|