VirtualBox

source: vbox/trunk/src/VBox/Main/include/ExtPackManagerImpl.h@ 33598

Last change on this file since 33598 was 33521, checked in by vboxsync, 14 years ago

ExtPack: More code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1/* $Id: ExtPackManagerImpl.h 33521 2010-10-27 15:20:21Z vboxsync $ */
2/** @file
3 * VirtualBox Main - interface for Extension Packs, VBoxSVC & VBoxC.
4 */
5
6/*
7 * Copyright (C) 2010 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_EXTPACKMANAGERIMPL
19#define ____H_EXTPACKMANAGERIMPL
20
21#include "VirtualBoxBase.h"
22#include <VBox/ExtPack/ExtPack.h>
23
24
25/**
26 * An extension pack.
27 *
28 * This
29 */
30class ATL_NO_VTABLE ExtPack :
31 public VirtualBoxBase,
32 VBOX_SCRIPTABLE_IMPL(IExtPack)
33{
34public:
35 /** @name COM and internal init/term/mapping cruft.
36 * @{ */
37 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(ExtPack, IExtPack)
38 DECLARE_NOT_AGGREGATABLE(ExtPack)
39 DECLARE_PROTECT_FINAL_CONSTRUCT()
40 BEGIN_COM_MAP(ExtPack)
41 COM_INTERFACE_ENTRY(ISupportErrorInfo)
42 COM_INTERFACE_ENTRY(IExtPack)
43 COM_INTERFACE_ENTRY(IDispatch)
44 END_COM_MAP()
45 DECLARE_EMPTY_CTOR_DTOR(ExtPack)
46
47 HRESULT FinalConstruct();
48 void FinalRelease();
49 HRESULT init(const char *a_pszName, const char *a_pszParentDir);
50 void uninit();
51 /** @} */
52
53 /** @name IExtPack interfaces
54 * @{ */
55 STDMETHOD(COMGETTER(Name))(BSTR *a_pbstrName);
56 STDMETHOD(COMGETTER(Version))(BSTR *a_pbstrVersion);
57 STDMETHOD(COMGETTER(Revision))(ULONG *a_puRevision);
58 STDMETHOD(COMGETTER(Usable))(BOOL *a_pfUsable);
59 STDMETHOD(COMGETTER(WhyUnusable))(BSTR *a_pbstrWhy);
60 /** @} */
61
62 /** @name Internal interfaces used by ExtPackManager.
63 * @{ */
64 void *getCallbackTable();
65 HRESULT refresh(bool *pfCanDelete);
66 /** @} */
67
68private:
69 struct Data;
70 /** Pointer to the private instance. */
71 Data *m;
72
73 friend class ExtPackManager;
74};
75
76
77/**
78 * Extension pack manager.
79 */
80class ATL_NO_VTABLE ExtPackManager :
81 public VirtualBoxBase,
82 VBOX_SCRIPTABLE_IMPL(IExtPackManager)
83{
84 /** @name COM and internal init/term/mapping cruft.
85 * @{ */
86 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(ExtPackManager, IExtPackManager)
87 DECLARE_NOT_AGGREGATABLE(ExtPackManager)
88 DECLARE_PROTECT_FINAL_CONSTRUCT()
89 BEGIN_COM_MAP(ExtPackManager)
90 COM_INTERFACE_ENTRY(ISupportErrorInfo)
91 COM_INTERFACE_ENTRY(IExtPackManager)
92 COM_INTERFACE_ENTRY(IDispatch)
93 END_COM_MAP()
94 DECLARE_EMPTY_CTOR_DTOR(ExtPackManager)
95
96 HRESULT FinalConstruct();
97 void FinalRelease();
98 HRESULT init();
99 void uninit();
100 /** @} */
101
102 /** @name IExtPack interfaces
103 * @{ */
104 STDMETHOD(COMGETTER(InstalledExtPacks))(ComSafeArrayOut(IExtPack *, a_paExtPacks));
105 STDMETHOD(Find)(IN_BSTR a_bstrName, IExtPack **a_pExtPack);
106 STDMETHOD(Install)(IN_BSTR a_bstrTarball, BSTR *a_pbstrName);
107 STDMETHOD(Uninstall)(IN_BSTR a_bstrName, BOOL a_fForcedRemoval);
108 /** @} */
109
110 /** @name Internal interfaces used by other Main classes.
111 * @{ */
112 int callAllConfigHooks(IConsole *a_pConsole, PVM a_pVM);
113 int callAllNewMachineHooks(IMachine *a_pMachine);
114 /** @} */
115
116private:
117 HRESULT runSetUidToRootHelper(const char *a_pszCommand, ...);
118 ExtPack *findExtPack(const char *a_pszName);
119 void removeExtPack(const char *a_pszName);
120 HRESULT refreshExtPack(const char *a_pszName, bool a_fUnsuableIsError, ExtPack **a_ppExtPack);
121
122private:
123 struct Data;
124 /** Pointer to the private instance. */
125 Data *m;
126};
127
128#endif
129/* 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