VirtualBox

source: vbox/trunk/src/VBox/Main/include/SharedFolderImpl.h@ 30760

Last change on this file since 30760 was 30760, checked in by vboxsync, 15 years ago

Main: separate internal machine data structs into MachineImplPrivate.h to significantly speed up compilation and for better interface separation; remove obsolete ConsoleEvents.h file

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1/** @file
2 *
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006-2009 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.215389.xyz. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ____H_SHAREDFOLDERIMPL
19#define ____H_SHAREDFOLDERIMPL
20
21#include "VirtualBoxBase.h"
22#include <VBox/shflsvc.h>
23
24class ATL_NO_VTABLE SharedFolder :
25 public VirtualBoxBaseWithChildrenNEXT,
26 VBOX_SCRIPTABLE_IMPL(ISharedFolder)
27{
28public:
29
30 struct Data
31 {
32 Data() {}
33
34 const Bstr name;
35 const Bstr hostPath;
36 BOOL writable;
37 Bstr lastAccessError;
38 };
39
40 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(SharedFolder, ISharedFolder)
41
42 DECLARE_NOT_AGGREGATABLE(SharedFolder)
43
44 DECLARE_PROTECT_FINAL_CONSTRUCT()
45
46 BEGIN_COM_MAP(SharedFolder)
47 COM_INTERFACE_ENTRY (ISupportErrorInfo)
48 COM_INTERFACE_ENTRY (ISharedFolder)
49 COM_INTERFACE_ENTRY2 (IDispatch, ISharedFolder)
50 END_COM_MAP()
51
52 DECLARE_EMPTY_CTOR_DTOR (SharedFolder)
53
54 HRESULT FinalConstruct();
55 void FinalRelease();
56
57 // public initializer/uninitializer for internal purposes only
58 HRESULT init(Machine *aMachine, CBSTR aName, CBSTR aHostPath, BOOL aWritable);
59 HRESULT initCopy(Machine *aMachine, SharedFolder *aThat);
60 HRESULT init(Console *aConsole, CBSTR aName, CBSTR aHostPath, BOOL aWritable);
61 HRESULT init(VirtualBox *aVirtualBox, CBSTR aName, CBSTR aHostPath, BOOL aWritable);
62 void uninit();
63
64 // ISharedFolder properties
65 STDMETHOD(COMGETTER(Name)) (BSTR *aName);
66 STDMETHOD(COMGETTER(HostPath)) (BSTR *aHostPath);
67 STDMETHOD(COMGETTER(Accessible)) (BOOL *aAccessible);
68 STDMETHOD(COMGETTER(Writable)) (BOOL *aWritable);
69 STDMETHOD(COMGETTER(LastAccessError)) (BSTR *aLastAccessError);
70
71 // public methods for internal purposes only
72 // (ensure there is a caller and a read lock before calling them!)
73
74 // public methods that don't need a lock (because access constant data)
75 // (ensure there is a caller added before calling them!)
76
77 const Bstr& getName() const { return m.name; }
78 const Bstr& getHostPath() const { return m.hostPath; }
79 BOOL isWritable() const { return m.writable; }
80
81protected:
82
83 HRESULT protectedInit(VirtualBoxBase *aParent,
84 CBSTR aName, CBSTR aHostPath, BOOL aWritable);
85
86private:
87
88 VirtualBoxBase * const mParent;
89
90 /* weak parents (only one of them is not null) */
91 Machine * const mMachine;
92 Console * const mConsole;
93 VirtualBox * const mVirtualBox;
94
95 Data m;
96};
97
98#endif // ____H_SHAREDFOLDERIMPL
99/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette