2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2006-10-18 09:02:36 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2006-10-18 09:02:36 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
2006-10-18 09:02:36 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2006-10-18 09:02:36 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2006-10-18 09:02:36 +00:00
|
|
|
|
|
|
|
#ifndef _SKINMANAGER_H_
|
|
|
|
#define _SKINMANAGER_H_
|
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma interface "SkinManager.cpp"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinItem : public wxObject
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinItem )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinItem();
|
|
|
|
~CSkinItem();
|
|
|
|
|
|
|
|
static wxColour ParseColor(wxString strColor);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinImage : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinImage )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinImage();
|
|
|
|
~CSkinImage();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
wxBitmap* GetBitmap();
|
|
|
|
wxColour* GetBackgroundColor();
|
2006-10-18 09:02:36 +00:00
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool SetDefaults(
|
|
|
|
wxString strComponentName,
|
|
|
|
const char** ppDefaultImage
|
|
|
|
);
|
|
|
|
|
|
|
|
bool SetDefaults(
|
|
|
|
wxString strComponentName,
|
|
|
|
const char** ppDefaultImage,
|
|
|
|
wxString strBackgroundColor
|
|
|
|
);
|
|
|
|
|
|
|
|
bool Validate();
|
2006-10-18 09:02:36 +00:00
|
|
|
|
|
|
|
private:
|
2006-10-29 09:30:29 +00:00
|
|
|
wxString m_strComponentName;
|
|
|
|
wxString m_strDesiredBitmap;
|
|
|
|
wxString m_strDesiredBackgroundColor;
|
|
|
|
const char** m_ppDefaultBitmap;
|
|
|
|
wxString m_strDefaultBackgroundColor;
|
|
|
|
wxBitmap m_bmpBitmap;
|
|
|
|
wxColour m_colBackgroundColor;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinIcon : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinIcon )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinIcon();
|
|
|
|
~CSkinIcon();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
|
|
|
wxIcon* GetIcon();
|
|
|
|
|
|
|
|
bool SetDefaults(
|
|
|
|
wxString strComponentName,
|
|
|
|
const char** ppDefaultIcon
|
|
|
|
);
|
|
|
|
|
|
|
|
bool Validate();
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxString m_strComponentName;
|
|
|
|
wxString m_strDesiredIcon;
|
|
|
|
wxString m_strDesiredTransparencyMask;
|
|
|
|
const char** m_ppDefaultIcon;
|
|
|
|
wxIcon m_icoIcon;
|
2006-10-18 09:02:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinSimple : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinSimple )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinSimple();
|
|
|
|
~CSkinSimple();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
2006-10-18 09:02:36 +00:00
|
|
|
|
2006-10-20 15:00:14 +00:00
|
|
|
CSkinImage* GetBackgroundImage() { return &m_BackgroundImage; }
|
2011-10-18 04:58:05 +00:00
|
|
|
CSkinImage* GetDialogBackgroundImage() { return &m_DialogBackgroundImage; }
|
|
|
|
CSkinImage* GetProjectImage() { return &m_ProjectImage; }
|
2006-10-20 15:00:14 +00:00
|
|
|
wxColour GetStaticLineColor() { return m_StaticLineColor; }
|
|
|
|
CSkinImage* GetWorkunitAnimationImage() { return &m_WorkunitAnimationImage; }
|
2011-10-18 04:58:05 +00:00
|
|
|
CSkinImage* GetWorkunitRunningImage() { return &m_WorkunitRunningImage; }
|
|
|
|
CSkinImage* GetWorkunitSuspendedImage() { return &m_WorkunitSuspendedImage; }
|
|
|
|
CSkinImage* GetWorkunitWaitingImage() { return &m_WorkunitWaitingImage; }
|
2006-10-20 15:00:14 +00:00
|
|
|
|
2006-10-18 09:02:36 +00:00
|
|
|
private:
|
|
|
|
CSkinImage m_BackgroundImage;
|
2011-10-18 04:58:05 +00:00
|
|
|
CSkinImage m_DialogBackgroundImage;
|
|
|
|
CSkinImage m_ProjectImage;
|
2006-10-18 09:02:36 +00:00
|
|
|
wxColour m_StaticLineColor;
|
|
|
|
CSkinImage m_WorkunitAnimationImage;
|
2011-10-18 04:58:05 +00:00
|
|
|
CSkinImage m_WorkunitRunningImage;
|
|
|
|
CSkinImage m_WorkunitSuspendedImage;
|
|
|
|
CSkinImage m_WorkunitWaitingImage;
|
2006-10-18 09:02:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinAdvanced : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinAdvanced )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinAdvanced();
|
|
|
|
~CSkinAdvanced();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
|
|
|
|
|
|
|
wxString GetApplicationName();
|
2007-08-16 18:53:42 +00:00
|
|
|
wxString GetApplicationShortName();
|
2006-10-29 09:30:29 +00:00
|
|
|
wxIcon* GetApplicationIcon();
|
2008-06-23 17:54:44 +00:00
|
|
|
wxIcon* GetApplicationIcon32();
|
2006-10-29 09:30:29 +00:00
|
|
|
wxIcon* GetApplicationDisconnectedIcon();
|
|
|
|
wxIcon* GetApplicationSnoozeIcon();
|
|
|
|
wxBitmap* GetApplicationLogo();
|
2007-08-16 18:53:42 +00:00
|
|
|
wxString GetOrganizationName();
|
|
|
|
wxString GetOrganizationWebsite();
|
|
|
|
wxString GetOrganizationHelpUrl();
|
2006-10-29 09:30:29 +00:00
|
|
|
int GetDefaultTab();
|
|
|
|
wxString GetExitMessage();
|
|
|
|
bool IsBranded();
|
2006-10-18 09:02:36 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_bIsBranded;
|
|
|
|
wxString m_strApplicationName;
|
2007-08-16 18:53:42 +00:00
|
|
|
wxString m_strApplicationShortName;
|
2006-10-29 09:30:29 +00:00
|
|
|
CSkinIcon m_iconApplicationIcon;
|
2008-06-23 17:54:44 +00:00
|
|
|
CSkinIcon m_iconApplicationIcon32;
|
2006-10-29 09:30:29 +00:00
|
|
|
CSkinIcon m_iconApplicationDisconnectedIcon;
|
|
|
|
CSkinIcon m_iconApplicationSnoozeIcon;
|
2006-10-18 09:02:36 +00:00
|
|
|
wxBitmap m_bitmapApplicationLogo;
|
2007-08-16 18:53:42 +00:00
|
|
|
wxString m_strOrganizationName;
|
|
|
|
wxString m_strOrganizationWebsite;
|
|
|
|
wxString m_strOrganizationHelpUrl;
|
2006-10-18 09:02:36 +00:00
|
|
|
bool m_bDefaultTabSpecified;
|
|
|
|
int m_iDefaultTab;
|
|
|
|
wxString m_strExitMessage;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-10-20 15:00:14 +00:00
|
|
|
class CSkinWizardATP : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinWizardATP )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinWizardATP();
|
|
|
|
~CSkinWizardATP();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
2006-10-20 15:00:14 +00:00
|
|
|
|
|
|
|
wxString GetWizardTitle() { return m_strTitle; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxString m_strTitle;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinWizardATAM : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinWizardATAM )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinWizardATAM();
|
|
|
|
~CSkinWizardATAM();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
2006-10-20 15:00:14 +00:00
|
|
|
|
|
|
|
wxString GetAccountInfoMessage() { return m_strAccountInfoMessage; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxString m_strAccountInfoMessage;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinWizards : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinWizards )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinWizards();
|
|
|
|
~CSkinWizards();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
2006-10-20 15:00:14 +00:00
|
|
|
|
|
|
|
CSkinWizardATP* GetWizardATP() { return &m_AttachToProjectWizard; }
|
|
|
|
CSkinWizardATAM* GetWizardATAM() { return &m_AttachToAccountManagerWizard; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
CSkinWizardATP m_AttachToProjectWizard;
|
|
|
|
CSkinWizardATAM m_AttachToAccountManagerWizard;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class CSkinManager : public CSkinItem
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS( CSkinManager )
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSkinManager();
|
2009-01-30 09:25:35 +00:00
|
|
|
CSkinManager(bool debugSkins);
|
2006-10-20 15:00:14 +00:00
|
|
|
~CSkinManager();
|
|
|
|
|
2011-03-10 10:25:54 +00:00
|
|
|
bool ReloadSkin(wxString strSkin);
|
2006-10-25 14:09:47 +00:00
|
|
|
|
|
|
|
wxArrayString& GetCurrentSkins();
|
|
|
|
wxString GetDefaultSkinName();
|
|
|
|
wxString GetSelectedSkin() { return m_strSelectedSkin; }
|
|
|
|
|
|
|
|
wxString ConstructSkinFileName();
|
|
|
|
wxString ConstructSkinPath();
|
|
|
|
wxString GetSkinFileName();
|
|
|
|
wxString GetSkinsLocation();
|
2006-10-20 15:00:14 +00:00
|
|
|
|
|
|
|
CSkinSimple* GetSimple() { return &m_SimpleSkin; }
|
|
|
|
CSkinAdvanced* GetAdvanced() { return &m_AdvancedSkin; }
|
|
|
|
CSkinWizards* GetWizards() { return &m_WizardsSkin; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
CSkinSimple m_SimpleSkin;
|
|
|
|
CSkinAdvanced m_AdvancedSkin;
|
|
|
|
CSkinWizards m_WizardsSkin;
|
|
|
|
|
2006-10-25 14:09:47 +00:00
|
|
|
wxArrayString m_astrSkins;
|
|
|
|
wxString m_strSelectedSkin;
|
|
|
|
|
2006-10-20 15:00:14 +00:00
|
|
|
void Clear();
|
|
|
|
int Parse(MIOFILE& in, wxString strDesiredLocale);
|
|
|
|
|
2006-10-29 09:30:29 +00:00
|
|
|
bool InitializeDelayedValidation();
|
2006-10-20 15:00:14 +00:00
|
|
|
};
|
|
|
|
|
2006-10-18 09:02:36 +00:00
|
|
|
|
|
|
|
#endif
|