tbx  0.7.6
resfontmenu.h
1 /*
2  * tbx RISC OS toolbox library
3  *
4  * Copyright (C) 2010 Alan Buckley All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 
25 #ifndef TBX_RES_RESFONTMENU_H
26 #define TBX_RES_RESFONTMENU_H
27 
28 #include "resobject.h"
29 
30 namespace tbx {
31 namespace res {
32 
36 class ResFontMenu : public ResObject
37 {
38 
39 public:
40  enum {CLASS_ID = 0x82a40 };
41 
48  ResFontMenu(const ResObject &other) : ResObject(other)
49  {
50  check_class_id(CLASS_ID);
51  }
52 
58  ResFontMenu(const ResFontMenu &other) : ResObject(other)
59  {
60  }
61 
62  virtual ~ResFontMenu() {}
63 
71  {
72  other.check_class_id(CLASS_ID);
73  ResBase::operator=(other);
74  return *this;
75  }
76 
83  {
84  ResBase::operator=(other);
85  return *this;
86  }
87 
95  ResFontMenu(std::string name)
96  : ResObject(name, CLASS_ID, 100, 36 + 8)
97  {
98  init_string(4,0); // ticked_font
99  }
100 
109  int flags() const {return int_value(0);}
118  void flags(int value) {int_value(0,value);}
124  bool generate_about_to_be_shown() const {return flag(0, 1<<0);}
130  void generate_about_to_be_shown(bool value) {flag(0,1<<0,value);}
136  bool generate_has_been_hidden() const {return flag(0, 1<<1);}
142  void generate_has_been_hidden(bool value) {flag(0,1<<1,value);}
148  bool include_system_font() const {return flag(0, 1<<2);}
154  void include_system_font(bool value) {flag(0,1<<2,value);}
155 
162  const char *ticked_font() const {return string(4);}
169  void ticked_font(const char *value) {string(4, value);}
176  void ticked_font(const std::string &value) {string(4, value);}
177 
178 };
179 
180 }
181 }
182 
183 #endif // TBX_RES_RESFONTMENU_H
tbx::res::ResBase::operator=
ResBase & operator=(const ResBase &other)
Assignment.
Definition: resbase.cc:1534
tbx
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
tbx::res::ResObject
Base class for a resource object that can be edited.
Definition: resobject.h:53
tbx::res::ResFontMenu::flags
void flags(int value)
Set all the flags.
Definition: resfontmenu.h:118
tbx::res::ResFontMenu::generate_has_been_hidden
bool generate_has_been_hidden() const
Check if the has been hidden event should be generated.
Definition: resfontmenu.h:136
tbx::res::ResBase::int_value
int int_value(int offset) const
Get an integer value.
Definition: resbase.h:316
tbx::res::ResFontMenu::operator=
ResFontMenu & operator=(const ResFontMenu &other)
Assign from another font menu resource.
Definition: resfontmenu.h:82
tbx::res::ResFontMenu::generate_has_been_hidden
void generate_has_been_hidden(bool value)
Set if the has been hidden event should be generated.
Definition: resfontmenu.h:142
tbx::res::ResFontMenu::operator=
ResFontMenu & operator=(const ResObject &other)
Assign from a ResObject.
Definition: resfontmenu.h:70
tbx::res::ResFontMenu::flags
int flags() const
Raw access to all the object flags.
Definition: resfontmenu.h:109
tbx::res::ResFontMenu::ticked_font
void ticked_font(const std::string &value)
Set the name of the font that should be selected.
Definition: resfontmenu.h:176
tbx::res::ResFontMenu::ResFontMenu
ResFontMenu(const ResFontMenu &other)
Construct a font menu resource by copying another.
Definition: resfontmenu.h:58
tbx::res::ResObject::check_class_id
void check_class_id(int class_id) const
Check if this objects class id is as specified.
Definition: resobject.cc:383
tbx::res::ResFontMenu::generate_about_to_be_shown
void generate_about_to_be_shown(bool value)
Set if the about to be shown event should be generated.
Definition: resfontmenu.h:130
tbx::res::ResFontMenu::ticked_font
const char * ticked_font() const
Get the name of the font that should be selected.
Definition: resfontmenu.h:162
tbx::res::ResBase::flag
bool flag(int offset, int mask) const
Check if any of the bits in a mask are set.
Definition: resbase.h:352
tbx::res::ResObject::name
const char * name() const
Return pointer to name of object.
Definition: resobject.h:79
tbx::res::ResFontMenu::include_system_font
void include_system_font(bool value)
Set if an option to select the system font should be included.
Definition: resfontmenu.h:154
tbx::res::ResFontMenu::ResFontMenu
ResFontMenu(const ResObject &other)
Construct a font menu resource from a ResObject.
Definition: resfontmenu.h:48
tbx::res::ResFontMenu::generate_about_to_be_shown
bool generate_about_to_be_shown() const
Check if the about to be shown event should be generated.
Definition: resfontmenu.h:124
tbx::res::ResBase::string
const char * string(int offset) const
Return a string at the given offset.
Definition: resbase.cc:1555
tbx::res::ResBase::init_string
void init_string(int offset, const char *value)
Initialise a string in a constructor helper.
Definition: resbase.cc:1725
tbx::res::ResFontMenu::ResFontMenu
ResFontMenu(std::string name)
Construct a font menu resource.
Definition: resfontmenu.h:95
tbx::res::ResFontMenu::ticked_font
void ticked_font(const char *value)
Set the name of the font that should be selected.
Definition: resfontmenu.h:169
tbx::res::ResFontMenu::include_system_font
bool include_system_font() const
Check if an option to select the system font should be included.
Definition: resfontmenu.h:148
tbx::res::ResFontMenu
Class for FontMenu object template.
Definition: resfontmenu.h:37