24 #include <kstandarddirs.h>
29 #include "printstyle.h"
30 #include "printingwizard.h"
32 using namespace KABPrinting;
36 : TQObject( parent, name ), mWizard( parent ), mSortField( 0 )
40 PrintStyle::~PrintStyle()
57 TQString path = locate(
"appdata",
"printing/" + fileName );
58 if ( path.isEmpty() ) {
59 kdDebug(5720) <<
"PrintStyle::setPreview: preview not locatable." << endl;
66 kdDebug(5720) <<
"PrintStyle::setPreview: preview at '" << path <<
"' cannot be loaded." << endl;
79 if ( mPageList.find( page ) == -1 ) {
80 mPageList.append( page );
81 mPageTitles.append( title );
89 for ( wdg = mPageList.first(); wdg; wdg = mPageList.next(), ++i ) {
90 mWizard->addPage( wdg, mPageTitles[ i ] );
92 mWizard->setAppropriate( wdg,
true );
96 mWizard->setFinishEnabled( wdg,
true );
101 for ( TQWidget *wdg = mPageList.first(); wdg; wdg = mPageList.next() )
102 mWizard->removePage( wdg );
108 mSortType = ascending;
121 PrintStyleFactory::PrintStyleFactory(
PrintingWizard* parent,
const char* name )
122 : mParent( parent ), mName( name )
126 PrintStyleFactory::~PrintStyleFactory()
130 #include "printstyle.moc"
bool setPreview(const TQString &fileName)
Load the preview image from the kaddressbook data directory.
The PrintingWizard combines pages common for all print styles and those provided by the respective st...
void addPage(TQWidget *page, const TQString &title)
Add additional page to the wizard e.g.
void setPreferredSortOptions(TDEABC::Field *field, bool ascending=true)
Set preferred sort options for this printing style.
void showPages()
Show all style specific pages in the wizard.
bool preferredSortType()
Returns the preferred sort type.
TDEABC::Field * preferredSortField()
Returns the preferred sort criterion field.
void hidePages()
Hide all style specific pages in the wizard.
const TQPixmap & preview()
Reimplement this method to provide a preview of what will be printed.
PrintingWizard * wizard()
Return the wizard object.