CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
FxUIIcon.h
Go to the documentation of this file.
1//
2// (C) Copyright 2005-2025 by Graebert GmbH.
3//
4// Permission to use, copy, modify, and distribute this software in
5// object code form for any purpose and without fee is hereby granted,
6// provided that the above copyright notice appears in all copies and
7// that both that copyright notice and the limited warranty and
8// restricted rights notice below appear in all supporting
9// documentation.
10//
11// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15// UNINTERRUPTED OR ERROR FREE.
16
17#pragma once
18
22
24#include "FxUISize.h"
25#include "FxUIPixmap.h"
26
27#if defined( XENON )
28namespace Wt
29{
30 class WLink;
31}
32using FxNativeIcon = Wt::WLink;
33#else
34class QIcon;
35using FxNativeIcon = QIcon;
36#endif
37
38class CFxUIIconImpl;
39
41{
42public:
43
44 enum Mode
45 {
46 Normal = 0,
48 Active = 2,
50 };
51
52 enum State
53 {
54 Off = 1,
55 On = 0
56 };
57
60
63 CFxUIIcon( const CFxUIString& fileName );
64
66 CFxUIIcon( const CFxUIIcon& icon );
67 CFxUIIcon( const FxNativeIcon& icon );
68
71
73 CFxUIIcon& operator=( const CFxUIIcon& icon );
74
75 operator const FxNativeIcon&() const;
76
82 bool isNull() const;
83
96
110 CFxUIPixmap pixmap( int w, int h, CFxUIIcon::Mode mode = Normal, CFxUIIcon::State state = Off ) const;
111
123 void addFile( const CFxUIString& fileName, const CFxUISize& size = CFxUISize(), CFxUIIcon::Mode mode = Normal, CFxUIIcon::State state = Off );
124
131
138
139protected:
140 CFxUIIconImpl* m_pImpl = nullptr;
141};
#define COMMONUI_API
CFxString CFxUIString
QIcon FxNativeIcon
Definition FxUIIcon.h:35
CFxUIIcon(const CFxUIPixmap &pixmap)
CFxUIPixmap pixmap(const CFxUISize &size, CFxUIIcon::Mode mode=Normal, CFxUIIcon::State state=Off) const
CFxUIIcon & operator=(const CFxUIIcon &icon)
void addFile(const CFxUIString &fileName, const CFxUISize &size=CFxUISize(), CFxUIIcon::Mode mode=Normal, CFxUIIcon::State state=Off)
CFxUIIconImpl * m_pImpl
Definition FxUIIcon.h:140
CFxUIString url() const
bool isNull() const
CFxUIIcon(const CFxUIString &fileName)
void setUrl(CFxUIString url)
CFxUIIcon(const CFxUIIcon &icon)
CFxUIPixmap pixmap(int w, int h, CFxUIIcon::Mode mode=Normal, CFxUIIcon::State state=Off) const
CFxUIIcon(const FxNativeIcon &icon)
GLfloat GLfloat GLfloat GLfloat w
Definition gles2_ext.h:320
GLsizeiptr size
Definition gles2_ext.h:182
Definition FxString.h:30