kwave  18.07.70
ZoomToolBar.h
Go to the documentation of this file.
1 /***************************************************************************
2  ZoomToolBar.h - Toolbar for zoom control
3  -------------------
4  begin : 2014-08-12
5  copyright : (C) 2014 by Thomas Eschenbacher
6  email : Thomas Eschenbacher <Thomas.Eschenbacher@gmx.de>
7 
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #ifndef ZOOM_TOOL_BAR_H
20 #define ZOOM_TOOL_BAR_H
21 
22 #include "config.h"
23 
24 #include <QObject>
25 #include <QTimer>
26 
27 #include <KToolBar>
28 
29 #include "libkwave/LabelList.h"
30 #include "libkwave/MetaDataList.h"
31 #include "libkwave/Sample.h"
32 
33 class QAction;
34 class KComboBox;
35 class KMainWindow;
36 
37 namespace Kwave
38 {
39 
40  class FileContext;
41 
42  class ZoomToolBar: public KToolBar
43  {
44  Q_OBJECT
45  public:
51  ZoomToolBar(KMainWindow *parent, const QString &name);
52 
54  virtual ~ZoomToolBar();
55 
56  signals:
57 
59  void sigCommand(const QString &command);
60 
61  public slots:
62 
64  void contextSwitched(Kwave::FileContext *context);
65 
67  void contextDestroyed(Kwave::FileContext *context);
68 
73  void updateToolbar();
74 
83  void setZoomInfo(Kwave::FileContext *context, double zoom);
84 
85  private slots:
86 
88  void selectZoom(int index);
89 
91  void zoomSelection() {
92  emit sigCommand(_("view:zoom_selection()"));
93  }
94 
96  void zoomIn() {
97  emit sigCommand(_("view:zoom_in()"));
98  }
99 
101  void zoomOut() {
102  emit sigCommand(_("view:zoom_out()"));
103  }
104 
106  void zoomNormal() {
107  emit sigCommand(_("view:zoom_normal()"));
108  }
109 
111  void zoomAll() {
112  emit sigCommand(_("view:zoom_all()"));
113  }
114 
115  private:
116 
119 
122 
124  QAction *m_action_zoomin;
125 
128 
131 
134 
137 
139  KComboBox *m_zoomselect;
140 
141  };
142 
143 }
144 
145 #endif /* ZOOM_TOOL_BAR_H */
146 
147 //***************************************************************************
148 //***************************************************************************
void setZoomInfo(Kwave::FileContext *context, double zoom)
virtual ~ZoomToolBar()
QAction * m_action_zoomout
Definition: ZoomToolBar.h:127
Definition: App.h:33
void contextDestroyed(Kwave::FileContext *context)
QAction * m_action_zoomselect
Definition: ZoomToolBar.h:136
const char name[16]
Definition: memcpy.c:510
QAction * m_action_zoomin
Definition: ZoomToolBar.h:124
QAction * m_action_zoomall
Definition: ZoomToolBar.h:133
QAction * m_action_zoomselection
Definition: ZoomToolBar.h:121
void selectZoom(int index)
ZoomToolBar(KMainWindow *parent, const QString &name)
Definition: ZoomToolBar.cpp:50
void contextSwitched(Kwave::FileContext *context)
#define _(m)
Definition: memcpy.c:66
KComboBox * m_zoomselect
Definition: ZoomToolBar.h:139
Kwave::FileContext * m_context
Definition: ZoomToolBar.h:118
QAction * m_action_zoomnormal
Definition: ZoomToolBar.h:130
void sigCommand(const QString &command)