Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ShellIcons.h

Go to the documentation of this file.
00001 //
00002 // ShellIcons.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #if !defined(AFX_SHELLICONS_H__D01FAB3B_B7C7_46AE_B4AF_A1451B322A27__INCLUDED_)
00023 #define AFX_SHELLICONS_H__D01FAB3B_B7C7_46AE_B4AF_A1451B322A27__INCLUDED_
00024 
00025 #pragma once
00026 
00027 
00028 class CShellIcons
00029 {
00030 // Construction
00031 public:
00032         CShellIcons();
00033         virtual ~CShellIcons();
00034 
00035 // Operations
00036 public:
00037         void    Clear();
00038         int             Get(LPCTSTR pszFile, int nSize);
00039         int             Add(HICON hIcon, int nSize);
00040         HICON   ExtractIcon(int nIndex, int nSize);
00041 public:
00042         BOOL    Lookup(LPCTSTR pszType, HICON* phSmallIcon, HICON* phLargeIcon, CString* psName, CString* psMIME, HICON* phHugeIcon = NULL);
00043         CString GetTypeString(LPCTSTR pszFile);
00044 public:
00045         void    Draw(CDC* pDC, int nIcon, int nSize, int nX, int nY, COLORREF crBack = CLR_NONE, BOOL bSelected = FALSE);
00046 
00047 // Inlines
00048 public:
00049         inline CImageList* GetObject(int nSize) const
00050         {
00051                 switch ( nSize )
00052                 {
00053                 case 16:
00054                         return (CImageList*)&m_i16;
00055                 case 32:
00056                         return (CImageList*)&m_i32;
00057                 case 48:
00058                         return (CImageList*)&m_i48;
00059                 default:
00060                         return NULL;
00061                 }
00062         }
00063 
00064         inline HIMAGELIST GetHandle(int nSize) const
00065         {
00066                 switch ( nSize )
00067                 {
00068                 case 16:
00069                         return m_i16.m_hImageList;
00070                 case 32:
00071                         return m_i32.m_hImageList;
00072                 case 48:
00073                         return m_i48.m_hImageList;
00074                 default:
00075                         return NULL;
00076                 }
00077         }
00078 
00079 // Attributes
00080 protected:
00081         CImageList              m_i16;
00082         CImageList              m_i32;
00083         CImageList              m_i48;
00084 protected:
00085         CMapStringToPtr m_m16;
00086         CMapStringToPtr m_m32;
00087         CMapStringToPtr m_m48;
00088 
00089         HINSTANCE m_hUser;
00090         UINT (WINAPI *m_pfnPrivate)(LPCTSTR, int, int, int, HICON*, UINT*, UINT, UINT);
00091 
00092 };
00093 
00094 extern CShellIcons ShellIcons;
00095 
00096 enum
00097 {
00098         SHI_FILE,
00099         SHI_PLUS,
00100         SHI_MINUS,
00101         SHI_TICK,
00102         SHI_BUSY,
00103         SHI_FIREWALL,
00104         SHI_UNSTABLE,
00105         SHI_COMPUTER,
00106         SHI_EXECUTABLE,
00107         SHI_CHAT,
00108         SHI_BROWSE,
00109         SHI_FOLDER_CLOSED,
00110         SHI_FOLDER_OPEN,
00111         SHI_LOCKED,
00112         SHI_SEARCH,
00113         SHI_PARTIAL,
00114         SHI_CHEVRON,
00115         SHI_STAR,
00116         SHI_PREVIEW,
00117         SHI_COLLECTION,
00118         SHI_FAKE,
00119         SHI_COMMERCIAL,
00120         SHI_RATING_FAKE,
00121         SHI_RATING_AVERAGE,
00122         SHI_RATING_GOOD,
00123         SHI_MAX
00124 };
00125 
00126 enum
00127 {
00128         SHI_O_NULL,
00129         SHI_O_LOCKED,
00130         SHI_O_PARTIAL,
00131         SHI_O_COLLECTION,
00132         SHI_O_COMMERCIAL,
00133         SHI_O_RATING_FAKE,
00134         SHI_O_RATING_AVERAGE,
00135         SHI_O_RATING_GOOD,
00136         SHI_O_MAX
00137 };
00138 
00139 #endif // !defined(AFX_SHELLICONS_H__D01FAB3B_B7C7_46AE_B4AF_A1451B322A27__INCLUDED_)

Generated on Thu Dec 15 10:39:50 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2