VirtualBox

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

Last change on this file since 53401 was 50919, checked in by vboxsync, 11 years ago

6183 src-all/SharedFolderImpl.cpp

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/** @file
2 *
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006-2013 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. 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 "SharedFolderWrap.h"
22#include <VBox/shflsvc.h>
23
24class Console;
25
26class ATL_NO_VTABLE SharedFolder :
27 public SharedFolderWrap
28{
29public:
30
31 DECLARE_EMPTY_CTOR_DTOR (SharedFolder)
32
33 HRESULT FinalConstruct();
34 void FinalRelease();
35
36 // public initializer/uninitializer for internal purposes only
37 HRESULT init(Machine *aMachine, const Utf8Str &aName, const Utf8Str &aHostPath, bool aWritable, bool aAutoMount, bool fFailOnError);
38 HRESULT initCopy(Machine *aMachine, SharedFolder *aThat);
39 HRESULT init(Console *aConsole, const Utf8Str &aName, const Utf8Str &aHostPath, bool aWritable, bool aAutoMount, bool fFailOnError);
40// HRESULT init(VirtualBox *aVirtualBox, const Utf8Str &aName, const Utf8Str &aHostPath, bool aWritable, bool aAutoMount, bool fFailOnError);
41 void uninit();
42
43 // public methods for internal purposes only
44 // (ensure there is a caller and a read lock before calling them!)
45
46 /**
47 * Public internal method. Returns the shared folder's name. Needs caller! Locking not necessary.
48 * @return
49 */
50 const Utf8Str& i_getName() const;
51
52 /**
53 * Public internal method. Returns the shared folder's host path. Needs caller! Locking not necessary.
54 * @return
55 */
56 const Utf8Str& i_getHostPath() const;
57
58 /**
59 * Public internal method. Returns true if the shared folder is writable. Needs caller and locking!
60 * @return
61 */
62 bool i_isWritable() const;
63
64 /**
65 * Public internal method. Returns true if the shared folder is auto-mounted. Needs caller and locking!
66 * @return
67 */
68 bool i_isAutoMounted() const;
69
70protected:
71
72 HRESULT i_protectedInit(VirtualBoxBase *aParent,
73 const Utf8Str &aName,
74 const Utf8Str &aHostPath,
75 bool aWritable,
76 bool aAutoMount,
77 bool fFailOnError);
78private:
79
80 // wrapped ISharedFolder properies.
81 HRESULT getName(com::Utf8Str &aName);
82 HRESULT getHostPath(com::Utf8Str &aHostPath);
83 HRESULT getAccessible(BOOL *aAccessible);
84 HRESULT getWritable(BOOL *aWritable);
85 HRESULT getAutoMount(BOOL *aAutoMount);
86 HRESULT getLastAccessError(com::Utf8Str &aLastAccessError);
87
88 VirtualBoxBase * const mParent;
89
90 /* weak parents (only one of them is not null) */
91#if !defined(VBOX_COM_INPROC)
92 Machine * const mMachine;
93 VirtualBox * const mVirtualBox;
94#else
95 Console * const mConsole;
96#endif
97
98 struct Data; // opaque data struct, defined in SharedFolderImpl.cpp
99 Data *m;
100};
101
102#endif // ____H_SHAREDFOLDERIMPL
103/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

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