SUAPI-CppWrapper
C++WrapperforSketchUpCAPI
OptionsManager.hpp
1 //
2 // OptionsManager.hpp
3 // Sketchup C++ Wrapper for C API
4 // MIT License
5 //
6 // Copyright (c) 2017 Tom Kaneko
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 
15 // The above copyright notice and this permission notice shall be included in all
16 // copies or substantial portions of the Software.
17 
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 // SOFTWARE.
25 //
26 
27 #ifndef OptionsManager_hpp
28 #define OptionsManager_hpp
29 
30 #include <stdio.h>
31 #include <string>
32 #include <vector>
33 
34 #include <SketchUpAPI/model/options_manager.h>
35 #include <SketchUpAPI/model/options_provider.h>
36 #include "SUAPI-CppWrapper/String.hpp"
37 #include "SUAPI-CppWrapper/model/TypedValue.hpp"
38 
39 
40 namespace CW {
41 
42 // Forward Declarations:
43 //class Model;
44 
46  private:
47  SUOptionsProviderRef m_options_provider;
48  public:
50  OptionsProvider(SUOptionsProviderRef);
51  std::vector<std::string> keys() const;
52  TypedValue get_value(std::string key) const;
53  bool set_value(std::string key, const TypedValue& tval);
54 };
55 
57  private:
58  SUOptionsManagerRef m_options_manager;
59 
60  public:
62  OptionsManager(SUOptionsManagerRef options_manager);
63 
64  // Returns a list of the names of OptionProviders
65  std::vector<std::string> get_provider_names() const;
66 
67  // Return an OptionsProvider by name
68  OptionsProvider get_provider(const std::string&);
69 
70 };
71 
72 
73 } /* namespace CW */
74 
75 #endif /* OptionsManager_hpp */
Definition: Color.hpp:34