source: trunk/src/objects/RpChoice.h @ 3177

Last change on this file since 3177 was 3177, checked in by mmc, 12 years ago

Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.

File size: 1.6 KB
Line 
1/*
2 * ======================================================================
3 *  AUTHOR:  Derrick Kearney, Purdue University
4 *  Copyright (c) 2004-2012  HUBzero Foundation, LLC
5 *
6 *  See the file "license.terms" for information on usage and
7 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8 * ======================================================================
9 */
10#include <errno.h>
11#include "RpObject.h"
12#include "RpChain.h"
13
14#ifndef RAPPTURE_CHOICE_H
15#define RAPPTURE_CHOICE_H
16
17namespace Rappture {
18
19class Choice : public Object
20{
21    public:
22
23        Choice  (   const char *path,
24                    const char *val );
25
26        Choice  (   const char *path,
27                    const char *val,
28                    const char *label,
29                    const char *desc);
30
31        Choice  (   const Choice& o );
32        virtual ~Choice ();
33
34        Accessor<const char *> def;
35        Accessor<const char *> cur;
36
37        Choice& addOption ( const char *label,
38                            const char *desc,
39                            const char *val );
40
41        Choice& delOption ( const char *label);
42
43        const char *xml(size_t indent, size_t tabstop);
44        const int is() const;
45
46    private:
47
48        // hash or linked list of preset values
49        Rp_Chain *_options;
50
51        typedef struct {
52            Accessor<const char *> label;
53            Accessor<const char *> desc;
54            Accessor<const char *> val;
55        } option;
56};
57
58} // namespace Rappture
59
60/*--------------------------------------------------------------------------*/
61/*--------------------------------------------------------------------------*/
62
63#endif
Note: See TracBrowser for help on using the repository browser.