Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SysIconUtils.h « FileManager « 7zip « CPP - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 51294751838e707ad5ea7269cd1d4ce9629d9245 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SysIconUtils.h

#ifndef __SYSICONUTILS_H
#define __SYSICONUTILS_H

#include "Common/String.h"

struct CExtIconPair
{
  UString Ext;
  int IconIndex;
  UString TypeName;

};

inline bool operator==(const CExtIconPair &a1, const CExtIconPair &a2)
{
  return (a1.Ext == a2.Ext);
}

inline bool operator<(const CExtIconPair &a1, const CExtIconPair &a2)
{
  return (a1.Ext < a2.Ext);
}

class CExtToIconMap
{
  int _dirIconIndex;
  UString _dirTypeName;
  int _noExtIconIndex;
  UString _noExtTypeName;
  CObjectVector<CExtIconPair> _map;
public:
  CExtToIconMap(): _dirIconIndex(-1), _noExtIconIndex(-1) {}
  void Clear() 
  {
    _dirIconIndex = -1;
    _noExtIconIndex = -1;
    _map.Clear();
  }
  int GetIconIndex(UINT32 attributes, const UString &fileName, UString &typeName);
  int GetIconIndex(UINT32 attributes, const UString &fileName);
};

DWORD_PTR GetRealIconIndex(LPCTSTR path, UINT32 attributes, int &iconIndex);
#ifndef _UNICODE
DWORD_PTR GetRealIconIndex(LPCWSTR path, UINT32 attributes, int &iconIndex);
#endif
int GetIconIndexForCSIDL(int aCSIDL);

#endif