1 | /* $Id: SharedFolderImpl.h 69500 2017-10-28 15:14:05Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | *
|
---|
4 | * VirtualBox COM class implementation
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2017 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef ____H_SHAREDFOLDERIMPL
|
---|
20 | #define ____H_SHAREDFOLDERIMPL
|
---|
21 |
|
---|
22 | #include "SharedFolderWrap.h"
|
---|
23 | #include <VBox/shflsvc.h>
|
---|
24 |
|
---|
25 | class Console;
|
---|
26 |
|
---|
27 | class ATL_NO_VTABLE SharedFolder :
|
---|
28 | public SharedFolderWrap
|
---|
29 | {
|
---|
30 | public:
|
---|
31 |
|
---|
32 | DECLARE_EMPTY_CTOR_DTOR (SharedFolder)
|
---|
33 |
|
---|
34 | HRESULT FinalConstruct();
|
---|
35 | void FinalRelease();
|
---|
36 |
|
---|
37 | // public initializer/uninitializer for internal purposes only
|
---|
38 | HRESULT init(Machine *aMachine, const com::Utf8Str &aName, const com::Utf8Str &aHostPath, bool aWritable, bool aAutoMount, bool fFailOnError);
|
---|
39 | HRESULT initCopy(Machine *aMachine, SharedFolder *aThat);
|
---|
40 | HRESULT init(Console *aConsole, const com::Utf8Str &aName, const com::Utf8Str &aHostPath, bool aWritable, bool aAutoMount, bool fFailOnError);
|
---|
41 | // HRESULT init(VirtualBox *aVirtualBox, const Utf8Str &aName, const Utf8Str &aHostPath, bool aWritable, bool aAutoMount, bool fFailOnError);
|
---|
42 | void uninit();
|
---|
43 |
|
---|
44 | // public methods for internal purposes only
|
---|
45 | // (ensure there is a caller and a read lock before calling them!)
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * Public internal method. Returns the shared folder's name. Needs caller! Locking not necessary.
|
---|
49 | * @return
|
---|
50 | */
|
---|
51 | const Utf8Str& i_getName() const;
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * Public internal method. Returns the shared folder's host path. Needs caller! Locking not necessary.
|
---|
55 | * @return
|
---|
56 | */
|
---|
57 | const Utf8Str& i_getHostPath() const;
|
---|
58 |
|
---|
59 | /**
|
---|
60 | * Public internal method. Returns true if the shared folder is writable. Needs caller and locking!
|
---|
61 | * @return
|
---|
62 | */
|
---|
63 | bool i_isWritable() const;
|
---|
64 |
|
---|
65 | /**
|
---|
66 | * Public internal method. Returns true if the shared folder is auto-mounted. Needs caller and locking!
|
---|
67 | * @return
|
---|
68 | */
|
---|
69 | bool i_isAutoMounted() const;
|
---|
70 |
|
---|
71 | protected:
|
---|
72 |
|
---|
73 | HRESULT i_protectedInit(VirtualBoxBase *aParent,
|
---|
74 | const Utf8Str &aName,
|
---|
75 | const Utf8Str &aHostPath,
|
---|
76 | bool aWritable,
|
---|
77 | bool aAutoMount,
|
---|
78 | bool fFailOnError);
|
---|
79 | private:
|
---|
80 |
|
---|
81 | // wrapped ISharedFolder properies.
|
---|
82 | HRESULT getName(com::Utf8Str &aName);
|
---|
83 | HRESULT getHostPath(com::Utf8Str &aHostPath);
|
---|
84 | HRESULT getAccessible(BOOL *aAccessible);
|
---|
85 | HRESULT getWritable(BOOL *aWritable);
|
---|
86 | HRESULT getAutoMount(BOOL *aAutoMount);
|
---|
87 | HRESULT getLastAccessError(com::Utf8Str &aLastAccessError);
|
---|
88 |
|
---|
89 | VirtualBoxBase * const mParent;
|
---|
90 |
|
---|
91 | /* weak parents (only one of them is not null) */
|
---|
92 | #if !defined(VBOX_COM_INPROC)
|
---|
93 | Machine * const mMachine;
|
---|
94 | VirtualBox * const mVirtualBox;
|
---|
95 | #else
|
---|
96 | Console * const mConsole;
|
---|
97 | #endif
|
---|
98 |
|
---|
99 | struct Data; // opaque data struct, defined in SharedFolderImpl.cpp
|
---|
100 | Data *m;
|
---|
101 | };
|
---|
102 |
|
---|
103 | #endif // ____H_SHAREDFOLDERIMPL
|
---|
104 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|