source: trunk/src/global/wtl_app.hpp @ 558

Revision 558, 1.7 KB checked in by Eoin, 12 years ago (diff)

Settings stored in Application Folder if reg entry present.

Line 
1
2//         Copyright Eóin O'Callaghan 2006 - 2007.
3// Distributed under the Boost Software License, Version 1.0.
4//    (See accompanying file LICENSE_1_0.txt or copy at
5//          http://www.boost.org/LICENSE_1_0.txt)
6
7#ifndef GLOBAL_WTL_APP
8#define GLOBAL_WTL_APP
9
10#include <string>
11#include <vector>
12#include <sstream>
13
14#include <boost/signals.hpp>
15#include <boost/function.hpp>
16
17#include <boost/static_assert.hpp>
18#include <boost/filesystem/path.hpp>
19#include <boost/filesystem/operations.hpp>
20
21#include <stlsoft/properties/method_properties.hpp>
22#include <stlsoft/util/operator_bool_adaptor.hpp>
23
24namespace hal
25{
26
27class app_impl;
28
29class app_module
30{
31public: 
32        const std::wstring& exe_string() const;
33
34        const boost::filesystem::wpath& exe_path() const;
35        const boost::filesystem::wpath& initial_path() const;
36
37        const boost::filesystem::wpath& get_working_directory() const;
38        void set_working_directory(const boost::filesystem::wpath& p);
39       
40        const boost::optional<boost::filesystem::wpath>& get_local_appdata() const;
41       
42        const std::vector<std::wstring>& command_args() const;
43       
44        std::wstring res_wstr(unsigned uID);   
45        void res_set_dll(std::wstring dll);
46        void res_revert();
47        std::pair<void*,size_t> res_find_lock(unsigned name, unsigned type);
48       
49        friend app_module& app();
50
51        STLSOFT_METHOD_PROPERTY_GET_EXTERNAL(const boost::optional<boost::filesystem::wpath>&, app_module, 
52                get_local_appdata, local_appdata);
53
54        STLSOFT_METHOD_PROPERTY_GETSET_EXTERNAL(const boost::filesystem::wpath&, const boost::filesystem::wpath&, 
55                app_module, get_working_directory, set_working_directory, working_directory);
56       
57private:
58        boost::scoped_ptr<app_impl> pimpl;
59       
60        app_module();
61};
62
63app_module& app();
64
65}
66
67#endif // GLOBAL_WTL_APP
Note: See TracBrowser for help on using the repository browser.