~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to kplato/libs/ui/kptviewbase.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* This file is part of the KDE project
2
 
  Copyright (C) 2006 Dag Andersen <danders@get2net.dk>
 
2
  Copyright (C) 2006 -2010 Dag Andersen <danders@get2net.dk>
3
3
 
4
4
  This library is free software; you can redistribute it and/or
5
5
  modify it under the terms of the GNU Library General Public
28
28
 
29
29
#include <KoView.h>
30
30
#include <KoPrintingDialog.h>
 
31
#include <KoPageLayout.h>
31
32
 
32
33
#include <QMap>
33
34
#include <QTreeView>
43
44
 
44
45
class KoDocument;
45
46
class KoPrintJob;
 
47
class KoPageLayoutWidget;
46
48
 
47
49
/// The main namespace
48
50
namespace KPlato
124
126
    PrintingOptions printingOptions() const;
125
127
    void setPrintingOptions( const PrintingOptions &opt);
126
128
    
 
129
    QWidget *createPageLayoutWidget() const;
 
130
    QAbstractPrintDialog::PrintDialogOptions printDialogOptions() const;
 
131
 
127
132
signals:
128
133
    void changed ( const PrintingOptions &opt );
129
134
    
135
140
    int headerFooterHeight( const PrintingOptions::Data &options ) const;
136
141
    void drawBottomRect( QPainter &p, const QRect &r );
137
142
 
 
143
    void setPrinterPageLayout();
 
144
 
138
145
protected:
139
146
    ViewBase *m_view;
140
147
    QPointer<PrintingHeaderFooter> m_widget;
195
202
    bool isActive() const;
196
203
    
197
204
    /// Set the project this view shall handle.
198
 
    virtual void setProject( Project * /*project*/ ) {}
 
205
    virtual void setProject( Project *project ) { m_proj = project; }
199
206
    /// Return the project
200
 
    virtual Project *project() const { return 0; }
 
207
    virtual Project *project() const { return m_proj; }
201
208
    /// Draw data from current part / project
202
209
    virtual void draw() {}
203
210
    /// Draw data from project.
225
232
    virtual bool loadContext( const KoXmlElement &/*context*/ ) { return false; }
226
233
    /// Save context info from this view. Reimplement.
227
234
    virtual void saveContext( QDomElement &/*context*/ ) const {}
228
 
    
229
 
    virtual ViewBase *hitView( const QPoint &pos );
230
235
 
231
236
    virtual KoPrintJob *createPrintJob();
232
237
    PrintingOptions printingOptions() const { return m_printingOptions; }
234
239
    
235
240
    void addAction( const QString list, QAction *action ) { ViewActionLists::addAction( list, action );  }
236
241
 
 
242
    KoPageLayout pageLayout() const { return m_pagelayout; }
 
243
 
237
244
public slots:
238
245
    /// Activate/deactivate the gui
239
246
    virtual void setGuiActive( bool activate );
240
 
 
 
247
    virtual void setScheduleManager( ScheduleManager *sm ) { m_schedulemanager = sm; }
241
248
    void slotUpdateReadWrite( bool );
242
249
    virtual void slotHeaderContextMenuRequested( const QPoint &pos );
243
250
 
244
251
    virtual void slotEditCopy() {}
245
252
    virtual void slotEditCut() {}
246
253
    virtual void slotEditPaste() {}
 
254
    virtual void slotRefreshView() {}
 
255
    
 
256
    void setPageLayout( const KoPageLayout &layout ) { m_pagelayout = layout; }
247
257
 
248
258
signals:
249
259
    /// Emitted when the gui has been activated or deactivated
251
261
    /// Request for a context menu popup
252
262
    void requestPopupMenu( const QString&, const QPoint & );
253
263
    
 
264
    /// Emitted when options are modified
 
265
    void optionsModified();
 
266
 
254
267
protected slots:
255
268
    virtual void slotOptions() {}
 
269
    virtual void slotOptionsFinished( int result );
256
270
 
257
271
protected:
258
272
    void createOptionAction();
259
273
    
260
274
    bool m_readWrite;
261
275
    PrintingOptions m_printingOptions;
 
276
    
 
277
    Project *m_proj;
 
278
    ScheduleManager *m_schedulemanager;
 
279
    
 
280
    KoPageLayout m_pagelayout;
262
281
};
263
282
 
264
283
//------------------
272
291
    virtual int documentFirstPage() const { return 1; }
273
292
    virtual int documentLastPage() const;
274
293
 
 
294
    QList<QWidget*> createOptionWidgets() const;
 
295
 
275
296
protected:
276
297
    virtual void printPage( int pageNumber, QPainter &painter );
277
298
 
416
437
    virtual int documentFirstPage() const { return 1; }
417
438
    virtual int documentLastPage() const;
418
439
 
 
440
    QList<QWidget*> createOptionWidgets() const;
 
441
 
419
442
protected:
420
443
    virtual void printPage( int pageNumber, QPainter &painter );
421
444
    
529
552
 
530
553
public slots:
531
554
    void edit( const QModelIndex &index );
532
 
 
 
555
    void expandAll();
 
556
    
533
557
protected slots:
534
558
    void slotSelectionChanged( const QItemSelection &sel, const QItemSelection & );
535
559
    void slotToRightView( const QModelIndex &index );