summaryrefslogtreecommitdiffstats
path: root/kword/KWFrameView.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kword/KWFrameView.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kword/KWFrameView.cpp')
-rw-r--r--kword/KWFrameView.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/kword/KWFrameView.cpp b/kword/KWFrameView.cpp
index d12a6b2d..38e7658a 100644
--- a/kword/KWFrameView.cpp
+++ b/kword/KWFrameView.cpp
@@ -33,14 +33,14 @@
#include <klocale.h>
#include <kactionclasses.h>
-#include <qapplication.h>
-#include <qpopupmenu.h>
+#include <tqapplication.h>
+#include <tqpopupmenu.h>
static const double HORIZONTAL_SNAP = 6; // horizontal snap zone (in pt)
static const double VERTICAL_SNAP = 6; // vertical snap zone (in pt)
-KWFrameView::KWFrameView(KWFrameViewManager *parent, KWFrame *frame) {
- m_manager = parent;
+KWFrameView::KWFrameView(KWFrameViewManager *tqparent, KWFrame *frame) {
+ m_manager = tqparent;
Q_ASSERT(frame);
Q_ASSERT(frame->frameSet());
m_frame = frame;
@@ -67,7 +67,7 @@ bool KWFrameView::isBorderHit(const KoPoint &point) const {
return hit(point, true, true);
}
-bool KWFrameView::contains(const KoPoint &point, bool fuzzy) const {
+bool KWFrameView::tqcontains(const KoPoint &point, bool fuzzy) const {
return hit(point, fuzzy, false);
}
@@ -120,15 +120,15 @@ void KWFrameView::setSelected(bool selected, MouseMeaning selectPolicy) {
m_selected = selected;
}
-void KWFrameView::showPopup( const KoPoint &point, KWView *view, const QPoint &popupPoint) const {
+void KWFrameView::showPopup( const KoPoint &point, KWView *view, const TQPoint &popupPoint) const {
view->unplugActionList( "tableactions" );
view->unplugActionList( "frameset_type_action" );
- QPopupMenu *popup = m_policy->createPopup(point, view);
+ TQPopupMenu *popup = m_policy->createPopup(point, view);
Q_ASSERT(popup);
popup->popup(popupPoint);
}
-void KWFrameView::paintFrameAttributes(QPainter *painter, const QRect &crect, KWViewMode *vm, KoZoomHandler *zh) {
+void KWFrameView::paintFrameAttributes(TQPainter *painter, const TQRect &crect, KWViewMode *vm, KoZoomHandler *zh) {
if( !m_selected )
return;
@@ -142,18 +142,18 @@ void KWFrameView::paintFrameAttributes(QPainter *painter, const QRect &crect, KW
readOnly = fs->isProtectSize() || fs->isMainFrameset() ||
fs->isAHeader() || fs->isAFooter() || fs->isFloating();
}
- void paint(QPainter *p, int x, int y) {
- p->setPen( QPen( Qt::black, 1, QPen::SolidLine ) );
- p->setBrush( QApplication::palette().color( QPalette::Active, QColorGroup::Highlight ) );
+ void paint(TQPainter *p, int x, int y) {
+ p->setPen( TQPen( TQt::black, 1, TQPen::SolidLine ) );
+ p->setBrush( TQApplication::palette().color( TQPalette::Active, TQColorGroup::Highlight ) );
p->drawRect( x, y, GRIP_SIZE, GRIP_SIZE );
if( readOnly ) { //protected frame
- QBrush brush = QApplication::palette().color( QPalette::Active,QColorGroup::Base );
+ TQBrush brush = TQApplication::palette().color( TQPalette::Active,TQColorGroup::Base );
p->fillRect( x+1, y+1, GRIP_SIZE-2, GRIP_SIZE-2, brush );
}
}
};
- const QRect frameRect = vm->normalToView( zh->zoomRect( *frame() ) );
+ const TQRect frameRect = vm->normalToView( zh->zoomRect( *frame() ) );
if ( crect.intersects( frameRect ) )
{
ResizeHandle handle(this);
@@ -178,16 +178,16 @@ FramePolicy::FramePolicy(KWFrameView *view) {
m_separator = new KActionSeparator();
m_view = view;
}
-void FramePolicy::addFloatingAction(KWView *view, QPtrList<KAction> &actionList) {
+void FramePolicy::addFloatingAction(KWView *view, TQPtrList<KAction> &actionList) {
if(m_view->frame()->frameSet()->isMainFrameset())
return;
actionList.append(m_separator);
KToggleAction *action = dynamic_cast<KToggleAction*> (view->actionCollection()->
action("inline_frame"));
Q_ASSERT(action);
- KWFrameSet *parentFs = m_view->frame()->frameSet()->groupmanager() ?
+ KWFrameSet *tqparentFs = m_view->frame()->frameSet()->groupmanager() ?
m_view->frame()->frameSet()->groupmanager() : m_view->frame()->frameSet();
- action->setChecked(parentFs->isFloating());
+ action->setChecked(tqparentFs->isFloating());
actionList.append(action);
}
MouseMeaning FramePolicy::mouseMeaningOnBorder( const KoPoint &point, int keyState ) {
@@ -206,7 +206,7 @@ MouseMeaning FramePolicy::mouseMeaningOnBorder( const KoPoint &point, int keySta
return MEANING_TOPLEFT;
if(point.y() >= frame->bottom() - vs)
return MEANING_BOTTOMLEFT;
- if( QABS(frame->y() + frame->height() / 2 - point.y()) <= vs )
+ if( TQABS(frame->y() + frame->height() / 2 - point.y()) <= vs )
return MEANING_LEFT;
return MEANING_MOUSE_MOVE;
}
@@ -215,18 +215,18 @@ MouseMeaning FramePolicy::mouseMeaningOnBorder( const KoPoint &point, int keySta
return MEANING_TOPRIGHT;
if(point.y() >= frame->bottom() - vs)
return MEANING_BOTTOMRIGHT;
- if( QABS(frame->y() + frame->height() / 2 - point.y()) <= vs )
+ if( TQABS(frame->y() + frame->height() / 2 - point.y()) <= vs )
return MEANING_RIGHT;
return MEANING_MOUSE_MOVE;
}
if( frame->y() + vs >= point.y() ) { // top edge
- if( QABS(frame->x() + frame->width() / 2 - point.x() ) <= hs )
+ if( TQABS(frame->x() + frame->width() / 2 - point.x() ) <= hs )
return MEANING_TOP;
return MEANING_MOUSE_MOVE;
}
if( frame->bottom() - vs <= point.y() ) { // bottom edge
- if( QABS(frame->x() + frame->width() / 2 - point.x() ) <= hs )
+ if( TQABS(frame->x() + frame->width() / 2 - point.x() ) <= hs )
return MEANING_BOTTOM;
return MEANING_MOUSE_MOVE;
}
@@ -239,16 +239,16 @@ MouseMeaning TableFramePolicy::mouseMeaning( const KoPoint &point, int keyState
Q_UNUSED(point);
// Found a frame under the cursor
// Ctrl -> select
- if ( keyState & Qt::ControlButton )
+ if ( keyState & TQt::ControlButton )
return MEANING_MOUSE_SELECT;
// Shift _and_ at least a frame is selected already
// (shift + no frame selected is used to select text)
- if ( (keyState & Qt::ShiftButton) && m_view->parent()->selectedFrame() != 0 )
+ if ( (keyState & TQt::ShiftButton) && m_view->tqparent()->selectedFrame() != 0 )
return MEANING_MOUSE_SELECT;
return MEANING_MOUSE_INSIDE_TEXT;
}
-QPopupMenu* TableFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
+TQPopupMenu* TableFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
view->plugActionList( "tableactions", view->tableActions() );
if( m_view->isBorderHit(point) )
return view->popupMenu("frame_popup_table");
@@ -258,16 +258,16 @@ MouseMeaning TableFramePolicy::mouseMeaningOnBorder(const KoPoint &point, int ke
KWFrame *frame = m_view->frame();
double hs = HORIZONTAL_SNAP; // horizontal snap zone (in pt)
double vs = VERTICAL_SNAP; // vertical snap zone (in pt)
- bool ctrl = keyState & Qt::ControlButton;
+ bool ctrl = keyState & TQt::ControlButton;
- if ( QABS( frame->x() - point.x() ) < hs
+ if ( TQABS( frame->x() - point.x() ) < hs
&& point.y() >= frame->y() && point.y() <= frame->bottom() ) {
if( static_cast<KWTableFrameSet::Cell *>(frame->frameSet())->firstColumn() == 0 )
return MEANING_SELECT_ROW;
if(!ctrl)
return MEANING_RESIZE_COLUMN;
}
- if ( QABS( frame->y() - point.y() ) < vs
+ if ( TQABS( frame->y() - point.y() ) < vs
&& point.x() >= frame->x() && point.x() <= frame->right() ) {
if( static_cast<KWTableFrameSet::Cell *>(frame->frameSet())->firstRow() == 0 )
return MEANING_SELECT_COLUMN;
@@ -277,10 +277,10 @@ MouseMeaning TableFramePolicy::mouseMeaningOnBorder(const KoPoint &point, int ke
if (ctrl)
return MEANING_MOUSE_SELECT;
- if ( QABS( frame->right() - point.x() ) < hs
+ if ( TQABS( frame->right() - point.x() ) < hs
&& point.y() >= frame->y() && point.y() <= frame->bottom() )
return MEANING_RESIZE_COLUMN;
- if ( QABS( frame->bottom() - point.y() ) < vs
+ if ( TQABS( frame->bottom() - point.y() ) < vs
&& point.x() >= frame->x() && point.x() <= frame->right() )
return MEANING_MOUSE_SELECT;
return MEANING_NONE;
@@ -291,7 +291,7 @@ void TableFramePolicy::setSelected(MouseMeaning selectPolicy) {
unsigned int column = static_cast<KWTableFrameSet::Cell *>(fs)->firstColumn();
for (KWTableFrameSet::TableIter cells(fs->groupmanager()); cells; ++cells) {
if(cells->firstColumn() >= column && cells->lastColumn() <= column) {
- KWFrameView *fv = m_view->parent()->view(cells->frame(0));
+ KWFrameView *fv = m_view->tqparent()->view(cells->frame(0));
if(fv)
fv->setSelected(true);
}
@@ -301,7 +301,7 @@ void TableFramePolicy::setSelected(MouseMeaning selectPolicy) {
unsigned int row = static_cast<KWTableFrameSet::Cell *>(fs)->firstRow();
for (KWTableFrameSet::TableIter cells(fs->groupmanager()); cells; ++cells) {
if(cells->firstRow() >= row && cells->lastRow() <= row) {
- KWFrameView *fv = m_view->parent()->view(cells->frame(0));
+ KWFrameView *fv = m_view->tqparent()->view(cells->frame(0));
if(fv)
fv->setSelected(true);
}
@@ -317,19 +317,19 @@ PartFramePolicy::PartFramePolicy(KWFrameView *view) : FramePolicy (view) {
MouseMeaning PartFramePolicy::mouseMeaning( const KoPoint &point, int keyState ) {
Q_UNUSED(point);
// Clicking on a selected part frame, but not on its border -> either resize or "activate part"
- if( keyState & Qt::ControlButton ) {
+ if( keyState & TQt::ControlButton ) {
return m_view->selected() ? MEANING_MOUSE_MOVE : MEANING_MOUSE_SELECT;
}
if ( m_view->selected() )
return MEANING_ACTIVATE_PART;
return MEANING_MOUSE_SELECT;
}
-QPopupMenu* PartFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
+TQPopupMenu* PartFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
Q_UNUSED(point);
KWPartFrameSet *part = static_cast<KWPartFrameSet *>(m_view->frame()->frameSet());
KActionSeparator *separator=new KActionSeparator();
KActionCollection *actionCollection = view->actionCollection();
- QPtrList<KAction> actionList;
+ TQPtrList<KAction> actionList;
actionList.append(separator);
if( !part->protectContent() ) {
KToggleAction *action = dynamic_cast<KToggleAction*>(actionCollection->action("embedded_store_internal"));
@@ -347,7 +347,7 @@ QPopupMenu* PartFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
TextFramePolicy::TextFramePolicy(KWFrameView *view) : FramePolicy (view) {
}
MouseMeaning TextFramePolicy::mouseMeaning( const KoPoint &point, int keyState ) {
- if( (keyState & Qt::ControlButton) == Qt::ControlButton )
+ if( (keyState & TQt::ControlButton) == TQt::ControlButton )
return MEANING_MOUSE_SELECT;
KWTextFrameSet *fs = dynamic_cast<KWTextFrameSet*>(m_view->frame()->frameSet());
if(fs == 0 || fs->kWordDocument() == 0)
@@ -364,12 +364,12 @@ MouseMeaning TextFramePolicy::mouseMeaning( const KoPoint &point, int keyState )
}
return MEANING_MOUSE_INSIDE_TEXT;
}
-QPopupMenu* TextFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
+TQPopupMenu* TextFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
if( m_view->isBorderHit(point) ) {
KWFrameSet *fs = m_view->frame()->frameSet();
KActionSeparator *separator=new KActionSeparator();
KActionCollection *actionCollection = view->actionCollection();
- QPtrList<KAction> actionList;
+ TQPtrList<KAction> actionList;
if(fs->isHeaderOrFooter()) {
actionList.append(separator);
actionList.append(actionCollection->action("configure_headerfooter"));
@@ -393,7 +393,7 @@ QPopupMenu* TextFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
KWTextFrameSetEdit *fse = static_cast<KWTextFrameSetEdit*> (view->getGUI()->
canvasWidget()->currentFrameSetEdit());
- QString word = fse->wordUnderCursor( *fse->cursor() );
+ TQString word = fse->wordUnderCursor( *fse->cursor() );
// Remove previous stuff
view->unplugActionList( "datatools" );
@@ -402,8 +402,8 @@ QPopupMenu* TextFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
view->unplugActionList( "datatools_link" );
// Those lists are stored in the KWView. Grab a ref to them.
- QPtrList<KAction> &actionList = view->dataToolActionList();
- QPtrList<KAction> &variableList = view->variableActionList();
+ TQPtrList<KAction> &actionList = view->dataToolActionList();
+ TQPtrList<KAction> &variableList = view->variableActionList();
actionList.clear();
variableList.clear();
@@ -443,7 +443,7 @@ QPopupMenu* TextFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
return view->popupMenu("footnote_popup");
}
if ( singleWord ) {
- QPtrList<KAction> actionCheckSpellList = view->listOfResultOfCheckWord( word );
+ TQPtrList<KAction> actionCheckSpellList = view->listOfResultOfCheckWord( word );
if ( !actionCheckSpellList.isEmpty() ) {
view->plugActionList( "spell_result_action", actionCheckSpellList );
return view->popupMenu("text_popup_spell_with_result");
@@ -462,11 +462,11 @@ MouseMeaning ImageFramePolicy::mouseMeaning( const KoPoint &point, int keyState
Q_UNUSED(keyState);
return m_view->selected() ? MEANING_MOUSE_MOVE: MEANING_MOUSE_SELECT;
}
-QPopupMenu* ImageFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
+TQPopupMenu* ImageFramePolicy::createPopup( const KoPoint &point, KWView *view ) {
Q_UNUSED(point);
KActionSeparator *separator=new KActionSeparator();
KActionCollection *actionCollection = view->actionCollection();
- QPtrList<KAction> actionList;
+ TQPtrList<KAction> actionList;
actionList.append(separator);
KAction *action = actionCollection->action("change_picture");
Q_ASSERT(action);