2 * Copyright (C) 2004-2008 Geometer Plus <contact@geometerplus.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 #ifndef __OPTIONSPAGE_H__
21 #define __OPTIONSPAGE_H__
25 #include <ZLOptionEntry.h>
27 class ZLDialogContent
;
31 class ComboOptionEntry
: public ZLComboOptionEntry
{
34 ComboOptionEntry(OptionsPage
&page
, const std::string
&initialValue
);
35 const std::string
&initialValue() const;
36 const std::vector
<std::string
> &values() const;
37 void onAccept(const std::string
&);
38 void onValueSelected(int index
);
39 void addValue(const std::string
&value
);
43 std::vector
<std::string
> myValues
;
44 std::string myInitialValue
;
50 virtual ~OptionsPage();
55 void registerEntry(ZLDialogContent
&tab
, const ZLResourceKey
&entryKey
, ZLOptionEntry
*entry
, const std::string
&name
);
56 void registerEntries(ZLDialogContent
&tab
, const ZLResourceKey
&entry0Key
, ZLOptionEntry
*entry0
, const ZLResourceKey
&entry1Key
, ZLOptionEntry
*entry1
, const std::string
&name
);
59 ComboOptionEntry
*myComboEntry
;
62 std::map
<ZLOptionEntry
*,std::string
> myEntries
;
64 friend class ComboOptionEntry
;
67 inline ComboOptionEntry::ComboOptionEntry(OptionsPage
&page
, const std::string
&initialValue
) : myPage(page
), myInitialValue(initialValue
) {}
68 inline const std::string
&ComboOptionEntry::initialValue() const { return myInitialValue
; }
69 inline const std::vector
<std::string
> &ComboOptionEntry::values() const { return myValues
; }
70 inline void ComboOptionEntry::onAccept(const std::string
&) {}
71 inline void ComboOptionEntry::addValue(const std::string
&value
) { myValues
.push_back(value
); }
73 inline OptionsPage::OptionsPage() {}
74 inline OptionsPage::~OptionsPage() {}
76 #endif /* __OPTIONSPAGE_H__ */