VR-Forces 4.0.4 Class Documentation
include/vrvCoreQt/DtKeyMappingEditorLogic.h
Go to the documentation of this file.
00001 /******************************************************************************* 
00002 ** Copyright (c) 2009 MAK Technologies, Inc. 
00003 ** All rights reserved. 
00004 *******************************************************************************/ 
00005 /******************************************************************************* 
00006 ** $RCSfile: DtKeyMappingEditorLogic.h,v $ $Revision: 1.12 $ $State: Exp $ 
00007 *******************************************************************************/ 
00008  
00012 
00013 #pragma once
00014 
00015 #include <vrvCoreQt/vrvCoreQt.h> 
00016 #include <vrvCore/DtKeyMap.h>
00017 #include <QtCore/QString>
00018 
00019 namespace makVrv 
00020 { 
00021    class DtDe;
00022    class DtKeyMappingEditorWidgetInterface;
00023    class DtPersistenceControlsInterface;
00024    class DtSelectInstanceWidget;
00025    class DtKeyMapManager;
00026 
00029    class DT_DLL_VRVCOREQT DtKeyMappingEditorLogic
00030    {
00031    public:
00032    
00034       DtKeyMappingEditorLogic(DtDe& de, DtPersistenceControlsInterface& toolbar,
00035          DtKeyMappingEditorWidgetInterface& iFace, DtSelectInstanceWidget& selectedInstance );
00036          
00038       virtual ~DtKeyMappingEditorLogic();
00039       
00041       void editKeyMapping();
00042    
00044       void addKeyMapping();
00045    
00047       void removeKeyMapping();
00048 
00050       void filterChanged( int functionCategory );
00051       
00053       void selectFunction( const std::string& functionName );
00054       
00056       void selectKeyMapping( const DtKeyMapping& keyMapping );
00057 
00059       void selectKeyMap( const std::string& keyMapping );
00060       
00062       void deselectFunctions();  
00063       
00066       void requestInputCanceled(); 
00067        
00070       void requestInputAccepted( const DtKeyMapping& keyMapping, bool isEdit );  
00071       
00075       void requestKeyValidationAccepted( const DtKeyMapping& keyMapping, 
00076          const DtKeyFunctionNameList& fnList, bool isEdit, bool replace );
00077 
00078    protected:
00079       virtual void setupGui();
00080 
00081       void setupFilters();
00082       void setupAllKeyFunctions();
00083       void setupKeyFunctions();
00084       void setupBinaryKeyFunctions();
00085       void updateAfterMappingChange();
00086       
00087       std::string keyMappingsToString( 
00088          const DtKeyMap::MappedKeyList& keyList, 
00089          bool suppressDirection=false );
00090          
00091       std::string mapNameFromFileName( const std::string& filename );
00092       
00093    protected:
00095       virtual void slot_currentInstanceChanged(int index, const std::string& keyMap);
00096 
00098       virtual void slot_keyMapRestored(DtKeyMapManager*, const std::string& map);
00099 
00101       virtual void onExport();
00102 
00105       virtual void onExportFilenameChosen(const std::string&);
00106 
00108       virtual void onImport();
00109 
00112       virtual void onImportFilenameChosen(const std::string&);
00113 
00115       virtual void slot_renameInstanceRequested();
00116 
00118       virtual void slot_newInstanceRequested();
00119 
00121       virtual void slot_deleteInstanceRequested();
00122 
00124       virtual QString askForKeyMapName(QString initial, const QString& title) const;
00125 
00126    protected:
00127    
00128       DtDe& myDe;
00129       DtPersistenceControlsInterface&     myToolbar;
00130       DtKeyMappingEditorWidgetInterface&  myInterface;
00131       DtSelectInstanceWidget&             mySelectedInstance;
00133       int myFilter;
00134       
00136       std::string myCurrentFunctionSelection;
00137       
00139       bool myCurrentFunctionIsBinary;
00140       
00142       DtKeyMapping myCurrentKeyMapping;
00143       
00145       DtKeyMap* myKeyMap;
00146       
00148       std::string myKeyMapName;
00149     };
00150 }

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)