VBoxSharedFoldersSettings.h revision 274d36678137d109570ab24ecdb0e1dd935b189f
0N/A/** @file
3909N/A *
0N/A * VBox frontends: Qt4 GUI ("VirtualBox"):
0N/A * VBoxSharedFoldersSettings class declaration
0N/A */
0N/A
2362N/A/*
0N/A * Copyright (C) 2006-2008 Sun Microsystems, Inc.
2362N/A *
0N/A * This file is part of VirtualBox Open Source Edition (OSE), as
0N/A * available from http://www.virtualbox.org. This file is free software;
0N/A * you can redistribute it and/or modify it under the terms of the GNU
0N/A * General Public License (GPL) as published by the Free Software
0N/A * Foundation, in version 2 as it comes in the "COPYING" file of the
0N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
0N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0N/A *
0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
0N/A * Clara, CA 95054 USA or visit http://www.sun.com if you need
0N/A * additional information or have any questions.
2362N/A */
2362N/A
2362N/A#ifndef __VBoxSharedFoldersSettings_h__
0N/A#define __VBoxSharedFoldersSettings_h__
0N/A
0N/A#include "VBoxSharedFoldersSettings.gen.h"
0N/A#include "QIWithRetranslateUI.h"
0N/A
0N/A/* Qt includes */
0N/A#include <QDialog>
0N/A
0N/Aclass QLineEdit;
0N/Aclass QPushButton;
0N/Aclass QCheckBox;
0N/Aclass SFTreeViewItem;
0N/A
0N/Aclass QIDialogButtonBox;
0N/A
0N/Aenum SFDialogType
0N/A{
0N/A WrongType = 0x00,
0N/A GlobalType = 0x01,
0N/A MachineType = 0x02,
0N/A ConsoleType = 0x04
0N/A};
0N/Atypedef QPair<QString, SFDialogType> SFolderName;
0N/Atypedef QList<SFolderName> SFoldersNameList;
0N/A
0N/Aclass VBoxSharedFoldersSettings : public QIWithRetranslateUI<QWidget>,
0N/A public Ui::VBoxSharedFoldersSettings
0N/A{
0N/A Q_OBJECT;
0N/A
0N/Apublic:
0N/A
0N/A VBoxSharedFoldersSettings (QWidget *aParent = 0, int aType = WrongType);
0N/A
0N/A int dialogType() { return mDialogType; }
0N/A
0N/A void getFromGlobal();
0N/A void getFromMachine (const CMachine &aMachine);
0N/A void getFromConsole (const CConsole &aConsole);
0N/A
0N/A void putBackToGlobal();
0N/A void putBackToMachine();
0N/A void putBackToConsole();
0N/A
0N/Aprotected:
0N/A
0N/A void retranslateUi();
0N/A
0N/Aprivate slots:
0N/A
0N/A void tbAddPressed();
0N/A void tbEditPressed();
0N/A void tbRemovePressed();
0N/A
0N/A void processCurrentChanged (QTreeWidgetItem *aCurrentItem,
0N/A QTreeWidgetItem *aPreviousItem = 0);
0N/A void processDoubleClick (QTreeWidgetItem *aItem, int aColumn);
0N/A
0N/A void adjustList();
0N/A void adjustFields();
0N/A
0N/Aprivate:
0N/A
0N/A void showEvent (QShowEvent *aEvent);
0N/A
0N/A void removeSharedFolder (const QString &aName, const QString &aPath,
0N/A SFDialogType aType);
0N/A void createSharedFolder (const QString &aName, const QString &aPath,
0N/A bool aWritable,
0N/A SFDialogType aType);
0N/A
0N/A void getFrom (const CSharedFolderEnumerator &aEn, SFTreeViewItem *aItem);
0N/A void putBackTo (CSharedFolderEnumerator &aEn, SFTreeViewItem *aItem);
0N/A
1181N/A SFTreeViewItem* searchRoot (bool aIsPermanent,
1181N/A SFDialogType aType = WrongType);
1181N/A bool isEditable (const QString &);
1181N/A SFoldersNameList usedList (bool aIncludeSelected);
1181N/A
0N/A int mDialogType;
0N/A bool mIsListViewChanged;
0N/A CMachine mMachine;
0N/A CConsole mConsole;
0N/A QString mTrFull;
0N/A QString mTrReadOnly;
0N/A};
0N/A
0N/Aclass VBoxAddSFDialog : public QIWithRetranslateUI<QDialog>
0N/A{
0N/A Q_OBJECT;
0N/A
0N/Apublic:
0N/A
0N/A enum DialogType
0N/A {
0N/A AddDialogType,
0N/A EditDialogType
0N/A };
0N/A
1181N/A VBoxAddSFDialog (VBoxSharedFoldersSettings *aParent,
0N/A VBoxAddSFDialog::DialogType aType,
1181N/A bool aEnableSelector /* for "permanent" checkbox */,
1181N/A const SFoldersNameList &aUsedNames);
1181N/A ~VBoxAddSFDialog() {}
1181N/A
1181N/A QString getPath();
1181N/A QString getName();
1181N/A bool getPermanent();
1181N/A bool getWritable();
1181N/A
1181N/A void setPath (const QString &aPath);
1181N/A void setName (const QString &aName);
1181N/A void setPermanent (bool aPermanent);
1181N/A void setWritable (bool aWritable);
0N/A
0N/Aprotected:
0N/A
0N/A void retranslateUi();
0N/A
0N/Aprivate slots:
0N/A
0N/A void validate();
0N/A void showFileDialog();
0N/A
0N/Aprivate:
0N/A
0N/A void showEvent (QShowEvent *aEvent);
0N/A
0N/A VBoxAddSFDialog::DialogType mType;
0N/A QIDialogButtonBox *mButtonBox;
0N/A QLabel *mLbPath;
0N/A QLineEdit *mLePath;
0N/A QToolButton *mTbPath;
0N/A QLabel *mLbName;
0N/A QLineEdit *mLeName;
0N/A QCheckBox *mCbPermanent;
0N/A QCheckBox *mCbReadonly;
0N/A SFoldersNameList mUsedNames;
0N/A};
0N/A
0N/A#endif // __VBoxSharedFoldersSettings_h__
0N/A
0N/A