• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdefile
 

tdeio/tdefile

  • tdeio
  • tdefile
kpropertiesdialog.h
1 /* This file is part of the KDE project
2  Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3  Copyright (c) 1999, 2000 Preston Brown <pbrown@kde.org>
4  Copyright (c) 2000 Simon Hausmann <hausmann@kde.org>
5  Copyright (c) 2000 David Faure <faure@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 /*
24  * This file holds the definitions for all classes used to
25  * display a properties dialog.
26  */
27 
28 #ifndef __propsdlg_h
29 #define __propsdlg_h
30 
31 #include <tqstring.h>
32 #include <tqptrlist.h>
33 
34 #include <kdemacros.h>
35 #include <kurl.h>
36 #include <tdefileitem.h>
37 #include <kdialogbase.h>
38 
39 class TQLineEdit;
40 class TQCheckBox;
41 class TQPushButton;
42 class KLineEdit;
43 class KURLRequester;
44 class TQButton;
45 class TDEIconButton;
46 class KPropsDlgPlugin;
47 class TQComboBox;
48 
49 #define KPropsPage KPropsDlgPlugin
50 
51 namespace TDEIO { class Job; }
52 
70 class TDEIO_EXPORT KPropertiesDialog : public KDialogBase
71 {
72  Q_OBJECT
73 
74 public:
75 
82  static bool canDisplay( KFileItemList _items );
83 
97  KPropertiesDialog( KFileItem * item,
98  TQWidget* parent = 0L, const char* name = 0L,
99  bool modal = false, bool autoShow = true);
100 
115  KPropertiesDialog( KFileItemList _items,
116  TQWidget *parent = 0L, const char* name = 0L,
117  bool modal = false, bool autoShow = true);
118 
119 #ifndef KDE_NO_COMPAT
120 
130  KPropertiesDialog( const KURL& _url, mode_t _mode,
131  TQWidget* parent = 0L, const char* name = 0L,
132  bool modal = false, bool autoShow = true) KDE_DEPRECATED;
133 #endif
134 
152  KPropertiesDialog( const KURL& _url,
153  TQWidget* parent = 0L, const char* name = 0L,
154  bool modal = false, bool autoShow = true);
155 
170  KPropertiesDialog( const KURL& _tempUrl, const KURL& _currentDir,
171  const TQString& _defaultName,
172  TQWidget* parent = 0L, const char* name = 0L,
173  bool modal = false, bool autoShow = true);
174 
184  KPropertiesDialog (const TQString& title,
185  TQWidget* parent = 0L, const char* name = 0L, bool modal = false);
186 
192  virtual ~KPropertiesDialog();
193 
203  static bool showDialog(KFileItem* item, TQWidget* parent = 0,
204  const char* name = 0, bool modal = false);
205 
215  static bool showDialog(const KURL& _url, TQWidget* parent = 0,
216  const char* name = 0, bool modal = false);
217 
228  static bool showDialog(const KFileItemList& _items, TQWidget* parent = 0,
229  const char* name = 0, bool modal = false);
230 
244  void insertPlugin (KPropsDlgPlugin *plugin);
245 
253  const KURL& kurl() const { return m_singleUrl; }
254 
262  KFileItem *item() { return m_items.first(); }
263 
267  KFileItemList items() const { return m_items; }
268 
273  KDE_DEPRECATED KDialogBase* dialog() { return this; }
278  KDE_DEPRECATED const KDialogBase* dialog() const { return this; }
279 
287  const KURL& currentDir() const { return m_currentDir; }
288 
295  const TQString& defaultName() const { return m_defaultName; }
296 
303  void updateUrl( const KURL& _newUrl );
304 
311  void rename( const TQString& _name );
312 
316  void abortApplying();
317 
325  void showFileSharingPage();
326 
335  void setFileSharingPage(TQWidget* page);
336 
343  void setFileNameReadOnly( bool ro );
344 
345 public slots:
349  virtual void slotOk(); // Deletes the PropertiesDialog instance
353  virtual void slotCancel(); // Deletes the PropertiesDialog instance
354 
355 signals:
360  void propertiesClosed();
361 
366  void applied();
367 
373  void canceled();
379  void saveAs(const KURL &oldUrl, KURL &newUrl);
380 
381 private:
382 
386  void init (bool modal = false, bool autoShow = true);
387 
391  void insertPages();
392 
396  KURL m_singleUrl;
397 
401  KFileItemList m_items;
402 
406  TQString m_defaultName;
407  KURL m_currentDir;
408 
412  TQPtrList<KPropsDlgPlugin> m_pageList;
413 
414 private slots:
415  void slotStatResult( TDEIO::Job * ); // No longer used
416 protected:
417  virtual void virtual_hook( int id, void* data );
418 private:
419  class KPropertiesDialogPrivate;
420  KPropertiesDialogPrivate *d;
421 };
422 
437 class TDEIO_EXPORT KPropsDlgPlugin : public TQObject
438 {
439  Q_OBJECT
440 public:
446  KPropsDlgPlugin( KPropertiesDialog *_props );
447  virtual ~KPropsDlgPlugin();
448 
454  virtual void applyChanges();
455 
460  static bool isDesktopFile( KFileItem * _item );
461 
462  void setDirty( bool b );
463  bool isDirty() const;
464 
465 public slots:
466  void setDirty(); // same as setDirty( true )
467 
468 signals:
474  void changed();
475 
476 protected:
480  KPropertiesDialog *properties;
481 
482  int fontHeight;
483 protected:
484  virtual void virtual_hook( int id, void* data );
485 private:
486  class KPropsDlgPluginPrivate;
487  KPropsDlgPluginPrivate *d;
488 };
489 
495 class TDEIO_EXPORT KFilePropsPlugin : public KPropsDlgPlugin
496 {
497  Q_OBJECT
498 public:
502  KFilePropsPlugin( KPropertiesDialog *_props );
503  virtual ~KFilePropsPlugin();
504 
510  virtual void applyChanges();
511 
515  static bool supports( KFileItemList _items );
516 
520  void postApplyChanges();
521 
522  void setFileNameReadOnly( bool ro );
523 
524 protected slots:
525  void slotEditFileType();
526  void slotCopyFinished( TDEIO::Job * );
527  void slotFileRenamed( TDEIO::Job *, const KURL &, const KURL & );
528  void slotDirSizeUpdate();
529  void slotDirSizeFinished( TDEIO::Job * );
530  void slotFoundMountPoint( const TQString& mp, unsigned long kBSize,
531  unsigned long kBUsed, unsigned long kBAvail );
532  void slotSizeStop();
533  void slotSizeDetermine();
534 
535 private slots:
536  // workaround for compiler bug
537  void slotFoundMountPoint( const unsigned long& kBSize, const unsigned long&
538  kBUsed, const unsigned long& kBAvail, const TQString& mp );
539  void nameFileChanged(const TQString &text );
540  void slotIconChanged();
541 
542 private:
543  void determineRelativePath( const TQString & path );
544  void applyIconChanges();
545 
546  TQWidget *iconArea;
547  TQWidget *nameArea;
548 
549  TQLabel *m_sizeLabel;
550  TQPushButton *m_sizeDetermineButton;
551  TQPushButton *m_sizeStopButton;
552 
553  TQString m_sRelativePath;
554  bool m_bFromTemplate;
555 
559  TQString oldName;
560 
561  class KFilePropsPluginPrivate;
562  KFilePropsPluginPrivate *d;
563 };
564 
571 class TDEIO_EXPORT KFilePermissionsPropsPlugin : public KPropsDlgPlugin
572 {
573  Q_OBJECT
574 public:
575  enum PermissionsMode {
576  PermissionsOnlyFiles = 0,
577  PermissionsOnlyDirs = 1,
578  PermissionsOnlyLinks = 2,
579  PermissionsMixed = 3
580  };
581 
582  enum PermissionsTarget {
583  PermissionsOwner = 0,
584  PermissionsGroup = 1,
585  PermissionsOthers = 2
586  };
587 
591  KFilePermissionsPropsPlugin( KPropertiesDialog *_props );
592  virtual ~KFilePermissionsPropsPlugin();
593 
594  virtual void applyChanges();
595 
599  static bool supports( KFileItemList _items );
600 
601 private slots:
602 
603  void slotChmodResult( TDEIO::Job * );
604  void slotShowAdvancedPermissions();
605 
606 private:
607  void setComboContent(TQComboBox *combo, PermissionsTarget target,
608  mode_t permissions, mode_t partial);
609  bool isIrregular(mode_t permissions, bool isDir, bool isLink);
610  void enableAccessControls(bool enable);
611  void updateAccessControls();
612  void getPermissionMasks(mode_t &andFilePermissions,
613  mode_t &andDirPermissions,
614  mode_t &orFilePermissions,
615  mode_t &orDirPermissions);
616 
617  static const mode_t permissionsMasks[3];
618  static const mode_t standardPermissions[4];
619  static const char *permissionsTexts[4][4];
620 
621  // unused, for binary compatibility!
622  TQCheckBox *permBox[3][4];
623 
624  TQComboBox *grpCombo;
625 
626  KLineEdit *usrEdit, *grpEdit;
627 
631  mode_t permissions;
635  TQString strGroup;
639  TQString strOwner;
640 
641  // unused, for compatibility
642  static mode_t fperm[3][4];
643 
644  class KFilePermissionsPropsPluginPrivate;
645  KFilePermissionsPropsPluginPrivate *d;
646 };
647 
648 
657 class TDEIO_EXPORT KURLPropsPlugin : public KPropsDlgPlugin
658 {
659  Q_OBJECT
660 public:
664  KURLPropsPlugin( KPropertiesDialog *_props );
665  virtual ~KURLPropsPlugin();
666 
667  virtual void applyChanges();
668 
669  static bool supports( KFileItemList _items );
670 
671 private:
672  KURLRequester *URLEdit;
673  TDEIconButton *iconBox;
674 
675  TQString URLStr;
676  TQString iconStr;
677 
678  TQPixmap pixmap;
679  TQString pixmapFile;
680 private:
681  class KURLPropsPluginPrivate;
682  KURLPropsPluginPrivate *d;
683 };
684 
685 
692 class TDEIO_EXPORT KBindingPropsPlugin : public KPropsDlgPlugin
693 {
694  Q_OBJECT
695 public:
699  KBindingPropsPlugin( KPropertiesDialog *_props );
700  virtual ~KBindingPropsPlugin();
701 
702  virtual void applyChanges();
703  static bool supports( KFileItemList _items );
704 
705 private:
706 
707  TQLineEdit *commentEdit;
708  TQLineEdit *patternEdit;
709  TQLineEdit *mimeEdit;
710  TQString m_sMimeStr;
711 
712  TQCheckBox * cbAutoEmbed;
713 
714  class KBindingPropsPluginPrivate;
715  KBindingPropsPluginPrivate *d;
716 };
717 
722 class TDEIO_EXPORT KDevicePropsPlugin : public KPropsDlgPlugin
723 {
724  Q_OBJECT
725 public:
726  KDevicePropsPlugin( KPropertiesDialog *_props );
727  virtual ~KDevicePropsPlugin();
728 
729  virtual void applyChanges();
730 
731  static bool supports( KFileItemList _items );
732 
733 private slots:
734  void slotActivated( int );
735  void slotDeviceChanged();
736  void slotFoundMountPoint( const unsigned long& kBSize,
737  const unsigned long& /*kBUsed*/,
738  const unsigned long& kBAvail,
739  const TQString& );
740 
741 private:
742  void updateInfo();
743  void processLockouts();
744 
745 private:
746  TQComboBox* device;
747  TQLabel* mountpoint;
748  TQCheckBox* readonly;
749  void* unused;
750  //TDEIconButton* mounted;
751  TDEIconButton* unmounted;
752 
753  TQStringList m_devicelist;
754  int indexDevice;
755  int indexMountPoint;
756  int indexFSType;
757 
758  TQPixmap pixmap;
759  TQString pixmapFile;
760 
761  class KDevicePropsPluginPrivate;
762  KDevicePropsPluginPrivate *d;
763 };
764 
765 class KPropertiesDesktopBase;
766 
775 class TDEIO_EXPORT KDesktopPropsPlugin : public KPropsDlgPlugin
776 {
777  Q_OBJECT
778 public:
782  KDesktopPropsPlugin( KPropertiesDialog *_props );
783  virtual ~KDesktopPropsPlugin();
784 
785  virtual void applyChanges();
786 
787  static bool supports( KFileItemList _items );
788 
789 public slots:
790  void slotAddFiletype();
791  void slotDelFiletype();
792  void slotBrowseExec();
793  void slotAdvanced();
794  void slotSelectMimetype();
795 
796 private:
797  void checkCommandChanged();
798 
799 private:
800  KPropertiesDesktopBase* w;
801 
802  TQString m_origCommandStr;
803  TQString m_terminalOptionStr;
804  TQString m_suidUserStr;
805  TQString m_dcopServiceType;
806  bool m_terminalBool;
807  bool m_terminalCloseBool;
808  bool m_suidBool;
809  bool m_startupBool;
810  bool m_systrayBool;
811 
812  class KDesktopPropsPluginPrivate;
813  KDesktopPropsPluginPrivate *d;
814 };
815 
825 class TDEIO_EXPORT_DEPRECATED KExecPropsPlugin : public KPropsDlgPlugin
827 {
828  Q_OBJECT
829 public:
833  KExecPropsPlugin( KPropertiesDialog *_props );
834  virtual ~KExecPropsPlugin();
835 
836  virtual void applyChanges();
837 
838  static bool supports( KFileItemList _items );
839 
840 public slots:
841  void slotBrowseExec();
842 
843 private slots:
844  void enableCheckedEdit();
845  void enableSuidEdit();
846 
847 private:
848 
849  TQLabel *terminalLabel;
850  TQLabel *suidLabel;
851  KLineEdit *execEdit;
852  TQCheckBox *terminalCheck;
853  TQCheckBox *suidCheck;
854  KLineEdit *terminalEdit;
855  KLineEdit *suidEdit;
856  KLineEdit *swallowExecEdit;
857  KLineEdit *swallowTitleEdit;
858  TQButton *execBrowse;
859 
860  TQString execStr;
861  TQString swallowExecStr;
862  TQString swallowTitleStr;
863  TQString termOptionsStr;
864  bool termBool;
865  bool suidBool;
866  TQString suidUserStr;
867 
868  class KExecPropsPluginPrivate;
869  KExecPropsPluginPrivate *d;
870 };
871 
881 class TDEIO_EXPORT_DEPRECATED TDEApplicationPropsPlugin : public KPropsDlgPlugin
883 {
884  Q_OBJECT
885 public:
889  TDEApplicationPropsPlugin( KPropertiesDialog *_props );
890  virtual ~TDEApplicationPropsPlugin();
891 
892  virtual void applyChanges();
893 
894  static bool supports( KFileItemList _items );
895 
896 public slots:
897  void slotDelExtension();
898  void slotAddExtension();
899 
900 private slots:
901  void updateButton();
902 
903 private:
904  void addMimeType( const TQString & name );
905 
906  TQLineEdit *commentEdit;
907  TQLineEdit *genNameEdit;
908  TQLineEdit *nameEdit;
909  TQListBox *extensionsList;
910  TQListBox *availableExtensionsList;
911  TQPushButton *addExtensionButton;
912  TQPushButton *delExtensionButton;
913 
914  class TDEApplicationPropsPluginPrivate;
915  TDEApplicationPropsPluginPrivate *d;
916 };
917 
918 #endif
919 
KPropertiesDialog::dialog
KDE_DEPRECATED KDialogBase * dialog()
Definition: kpropertiesdialog.h:273
KURLPropsPlugin
Used to edit the files containing [Desktop Entry] URL=....
Definition: kpropertiesdialog.h:657
KPropertiesDialog::items
KFileItemList items() const
Definition: kpropertiesdialog.h:267
KPropertiesDialog::kurl
const KURL & kurl() const
The URL of the file that has its properties being displayed.
Definition: kpropertiesdialog.h:253
TDEIO
Definition: kimagefilepreview.h:26
TDEIconButton
A pushbutton for choosing an icon.
Definition: kicondialog.h:257
KBindingPropsPlugin
Used to edit the files containing [Desktop Entry] Type=MimeType.
Definition: kpropertiesdialog.h:692
TDEApplicationPropsPlugin
Used to edit the files containing [Desktop Entry] Type=Application.
Definition: kpropertiesdialog.h:882
KFilePermissionsPropsPlugin
'Permissions' plugin In this plugin you can modify permissions and change the owner of a file...
Definition: kpropertiesdialog.h:571
KPropertiesDialog::currentDir
const KURL & currentDir() const
If the dialog is being built from a template, this method returns the current directory.
Definition: kpropertiesdialog.h:287
KPropertiesDialog::defaultName
const TQString & defaultName() const
If the dialog is being built from a template, this method returns the default name.
Definition: kpropertiesdialog.h:295
KFilePropsPlugin
'General' plugin This plugin displays the name of the file, its size and access times.
Definition: kpropertiesdialog.h:495
KPropertiesDialog::dialog
KDE_DEPRECATED const KDialogBase * dialog() const
Definition: kpropertiesdialog.h:278
KPropertiesDialog
The main properties dialog class.
Definition: kpropertiesdialog.h:70
KDesktopPropsPlugin
Used to edit the files containing [Desktop Entry] Type=Application.
Definition: kpropertiesdialog.h:775
KURLRequester
This class is a widget showing a lineedit and a button, which invokes a filedialog.
Definition: kurlrequester.h:56
KDevicePropsPlugin
Properties plugin for device .desktop files.
Definition: kpropertiesdialog.h:722
KPropertiesDialog::item
KFileItem * item()
Definition: kpropertiesdialog.h:262
KExecPropsPlugin
Used to edit the files containing [Desktop Entry] Type=Application.
Definition: kpropertiesdialog.h:826
KPropsDlgPlugin
A Plugin in the Properties dialog This is an abstract class.
Definition: kpropertiesdialog.h:437
KPropsDlgPlugin::applyChanges
virtual void applyChanges()
Applies all changes to the file.
Definition: kpropertiesdialog.cpp:665
KPropsDlgPlugin::properties
KPropertiesDialog * properties
Pointer to the dialog.
Definition: kpropertiesdialog.h:480

tdeio/tdefile

Skip menu "tdeio/tdefile"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeio/tdefile

Skip menu "tdeio/tdefile"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdefile by doxygen 1.8.8
This website is maintained by Timothy Pearson.