5 #ifndef CNOID_BASE_VIEW_H
6 #define CNOID_BASE_VIEW_H
8 #include <cnoid/Signal>
9 #include <cnoid/Widget>
10 #include "exportdecl.h"
14 class ExtensionManager;
24 virtual const std::string& className()
const = 0;
35 const std::string& name()
const;
36 virtual void setName(
const std::string& name);
37 void setTitleFormat(
const std::string& title);
38 void resetTitleFormat();
39 const std::string& titleFormat()
const;
43 bool isActive()
const;
44 bool hasFocus()
const;
66 LEFT_TOP = TopLeftArea,
67 LEFT_BOTTOM = BottomLeftArea,
70 BOTTOM = BottomCenterArea,
73 void setDefaultLayoutArea(LayoutArea area);
74 LayoutArea defaultLayoutArea()
const;
76 void setLayout(QLayout* layout,
double marginRatio = 0.0);
80 double leftMarginRatio,
double topMarginRatio,
double rightMarginRatio,
double bottomMarginRatio);
82 QPoint viewAreaPos()
const;
84 virtual QWidget* indicatorOnInfoBar();
86 void enableFontSizeZoomKeys(
bool on);
88 virtual bool storeState(
Archive& archive);
89 virtual bool restoreState(
const Archive& archive);
91 static View* lastFocusView();
94 void setLayoutContentsMarginRatio(
96 double leftMarginRatio,
double topMarginRatio,
double rightMarginRatio,
double bottomMarginRatio);
97 void zoomFontSize(
int zoom);
99 virtual void onActivated();
100 virtual void onDeactivated();
101 virtual void onFocusChanged(
bool on);
102 virtual void onAttachedMenuRequest(
MenuManager& menuManager);
103 virtual void keyPressEvent(QKeyEvent* event);
104 virtual void resizeEvent(QResizeEvent* event);
114 static void initializeClass();
116 static void onApplicationFocusChanged(QWidget* widget);
119 virtual void showEvent(QShowEvent* event);
120 virtual void hideEvent(QHideEvent* event);
123 void notifySigRemoved();