2 /// \file barrydesktop.h
3 /// Program entry point for the desktop GUI
7 Copyright (C) 2009-2012, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #ifndef __BARRYDESKTOP_BARRYDESKTOP_H__
23 #define __BARRYDESKTOP_BARRYDESKTOP_H__
26 #include <barry/barry.h>
36 std::auto_ptr
<wxSplashScreen
> m_splash
;
42 class BarryDesktopApp
: public wxApp
45 Barry::GlobalConfigFile m_global_config
;
46 Barry::Probe::Results m_results
;
47 std::auto_ptr
<OpenSync::APISet
> m_set
;
55 Barry::GlobalConfigFile
& GetGlobalConfig() { return m_global_config
; }
56 const Barry::Probe::Results
& GetResults() const { return m_results
; }
57 OpenSync::APISet
& GetOpenSync() { return *m_set
; }
63 void ShowMissingOpenSyncMessage();
65 /// Fills m_results with new data after a brand new scan.
66 /// Does not catch exceptions.
69 /// Grabs a screenshot of the given device.
70 /// Can throw exceptions on error.
71 wxBitmap
GetScreenshot(const Barry::ProbeResult
&device
) const;
73 /// Sets the device name for the given device PIN.
74 /// If the PIN exists in m_results, the associated
75 /// m_results entry will be updated with the new device name,
76 /// so the next GetResults() will contain the new name.
77 void SetDeviceName(Barry::Pin pin
, const std::string
&name
);
78 std::string
GetDeviceName(Barry::Pin pin
) const;
83 virtual bool OnInit();
87 DECLARE_APP(BarryDesktopApp
)