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

Skin.h

Go to the documentation of this file.
00001 //
00002 // Skin.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_SKIN_H__E4027F91_1EB1_4B0D_82E2_C8DD1E7F054F__INCLUDED_)
00023 #define AFX_SKIN_H__E4027F91_1EB1_4B0D_82E2_C8DD1E7F054F__INCLUDED_
00024 
00025 #pragma once
00026 
00027 #include "CoolMenu.h"
00028 
00029 class CCoolBarCtrl;
00030 class CXMLElement;
00031 class CSkinWindow;
00032 
00033 
00034 class CSkin
00035 {
00036 // Construction
00037 public:
00038         CSkin();
00039         virtual ~CSkin();
00040 
00041 // Operations
00042 public:
00043         void    Apply();
00044         void    Clear();
00045         BOOL    LoadFromFile(LPCTSTR pszFile);
00046         BOOL    LoadFromResource(HINSTANCE hInstance, UINT nResourceID);
00047         BOOL    LoadFromString(const CString& strXML, const CString& strPath);
00048         BOOL    LoadFromXML(CXMLElement* pXML, const CString& strPath);
00049         BOOL    SelectCaption(CWnd* pWnd, int nIndex);
00050         BOOL    SelectCaption(CString& strCaption, int nIndex);
00051         void    DrawWrappedText(CDC* pDC, CRect* pBox, LPCTSTR pszText, CPoint ptStart, BOOL bExclude = TRUE);
00052 protected:
00053         void    ApplyRecursive(LPCTSTR pszPath);
00054         void    CreateDefault();
00055         void    Finalise();
00056         HBITMAP LoadBitmap(CString& strName);
00057 
00058 // Strings
00059 public:
00060         BOOL    LoadString(CString& str, UINT nStringID);
00061         int             GetTextFlowChange(LPCTSTR pszText, BOOL* bIsRTL);
00062 protected:
00063         BOOL    LoadStrings(CXMLElement* pBase);
00064         CMap<UINT, UINT, CString, CString&>     m_pStrings;
00065 
00066 // Menus
00067 public:
00068         CMenu*  GetMenu(LPCTSTR pszName);
00069         UINT    TrackPopupMenu(LPCTSTR pszMenu, const CPoint& point, UINT nDefaultID = 0, UINT nFlags = 0);
00070         CMapStringToPtr m_pMenus;
00071 protected:
00072         BOOL    LoadMenus(CXMLElement* pBase);
00073         BOOL    LoadMenu(CXMLElement* pXML);
00074         BOOL    CreateMenu(CXMLElement* pXML, HMENU hMenu);
00075         CMenu   m_mnuDefault;
00076 
00077 // Toolbars
00078 public:
00079         BOOL    CreateToolBar(LPCTSTR pszName, CCoolBarCtrl* pBar);
00080         CMapStringToPtr m_pToolbars;
00081 protected:
00082         BOOL    LoadToolbars(CXMLElement* pBase);
00083         BOOL    CreateToolBar(CXMLElement* pElement);
00084 
00085 // Documents
00086 public:
00087         CXMLElement*    GetDocument(LPCTSTR pszName);
00088 protected:
00089         BOOL                    LoadDocuments(CXMLElement* pBase);
00090         CMapStringToPtr m_pDocuments;
00091 
00092 // Watermarks
00093 public:
00094         HBITMAP GetWatermark(LPCTSTR pszName);
00095         BOOL    GetWatermark(CBitmap* pBitmap, LPCTSTR pszName);
00096 protected:
00097         BOOL    LoadWatermarks(CXMLElement* pSub, const CString& strPath);
00098         CMapStringToString m_pWatermarks;
00099 
00100 // Translate
00101 public:
00102         BOOL    Translate(LPCTSTR pszName, CHeaderCtrl* pCtrl);
00103 protected:
00104         BOOL    LoadListColumns(CXMLElement* pBase);
00105         CMapStringToString m_pLists;
00106 
00107 // Dialogs
00108 public:
00109         BOOL    Apply(LPCTSTR pszName, CDialog* pDialog, UINT nIconID = 0);
00110         CString GetDialogCaption(LPCTSTR pszName);
00111 protected:
00112         BOOL    LoadDialogs(CXMLElement* pBase);
00113         CMapStringToPtr         m_pDialogs;
00114 
00115 // Window Skins
00116 public:
00117         CSkinWindow*    GetWindowSkin(LPCTSTR pszWindow, LPCTSTR pszAppend = NULL);
00118         CSkinWindow*    GetWindowSkin(CWnd* pWnd);
00119 protected:
00120         BOOL                    LoadWindowSkins(CXMLElement* pSub, const CString& strPath);
00121         CPtrList                m_pSkins;
00122 
00123 // Colour Scheme
00124 public:
00125         COLORREF        m_crDialog;
00126         CBrush          m_brDialog;
00127         COLORREF        m_crPanelBack;
00128         CBitmap         m_bmPanelMark;
00129         COLORREF        m_crPanelText;
00130         COLORREF        m_crPanelBorder;
00131         COLORREF        m_crBannerBack;
00132         COLORREF        m_crBannerText;
00133         COLORREF        m_crSchemaRow[2];
00134 protected:
00135         BOOL            LoadColourScheme(CXMLElement* pBase);
00136 
00137 // Fonts
00138 protected:
00139         CStringList     m_pFontPaths;
00140 protected:
00141         BOOL            LoadFonts(CXMLElement* pBase, const CString& strPath);
00142 
00143 // Other
00144 protected:
00145         UINT    LookupCommandID(CXMLElement* pXML, LPCTSTR pszName = NULL);
00146         BOOL    LoadCommandMap(CXMLElement* pBase);
00147         BOOL    LoadCommandImages(CXMLElement* pBase, const CString& strPath);
00148         BOOL    LoadCommandBitmap(CXMLElement* pBase, const CString& strPath);
00149 
00150 // Mode Suffixes
00151 protected:
00152         static LPCTSTR m_pszModeSuffix[3][4];
00153 
00154 };
00155 
00156 
00157 extern CSkin Skin;
00158 
00159 #endif // !defined(AFX_SKIN_H__E4027F91_1EB1_4B0D_82E2_C8DD1E7F054F__INCLUDED_)

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