KRename – powerful batch renamer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.7KB

  1. /***************************************************************************
  2. permission.h - description
  3. -------------------
  4. begin : Sun Jan 13 2002
  5. copyright : (C) 2002 by Dominik Seichter
  6. email : domseichter@web.de
  7. ***************************************************************************/
  8. /***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************/
  16. #ifndef PERMISSION_H
  17. #define PERMISSION_H
  18. /*
  19. * This two includes are required, because you have to use
  20. * krenames internal structures and enums.
  21. */
  22. #include "batchrenamer.h"
  23. #include "pluginloader.h"
  24. #include "plugin.h"
  25. #include "helpdialog.h"
  26. #include <stdio.h>
  27. class KComboBox;
  28. class TQCheckBox;
  29. class TQGroupBox;
  30. class TQVBoxLayout;
  31. class TQHBoxLayout;
  32. class TQString;
  33. class TQWidget;
  34. // Plugin class starts here
  35. class MyPermPlugin: public Plugin {
  36. Q_OBJECT
  37. TQ_OBJECT
  38. public:
  39. const TQString getName() const;
  40. const TQString getAccelName() const;
  41. const int type() const;
  42. bool checkError();
  43. void drawInterface( TQWidget* w, TQVBoxLayout* l );
  44. void fillStructure();
  45. TQString processFile( BatchRenamer* b, int, TQString token, int );
  46. void finished();
  47. const TQPixmap getIcon() const;
  48. private:
  49. int getPermissions();
  50. int getGid( TQString group );
  51. int getUid( TQString owner );
  52. struct pervals {
  53. bool changePermissions;
  54. bool changeOwner;
  55. TQString owner; // name of owner
  56. TQString group; // name of group
  57. int newPermission; // Permissions
  58. }perm;
  59. private slots:
  60. void enableControls();
  61. protected:
  62. TQGroupBox* groupPermission;
  63. TQGroupBox* groupOwner;
  64. TQCheckBox* checkPermissions;
  65. TQCheckBox* checkOwner;
  66. TQCheckBox* permBox[3][4];
  67. KComboBox* username;
  68. KComboBox* groupname;
  69. TQVBoxLayout* groupOwnerLayout;
  70. TQVBoxLayout* Layout0;
  71. TQHBoxLayout* Layout2;
  72. TQHBoxLayout* Layout3;
  73. TQHBoxLayout* Layout4;
  74. };
  75. #endif