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.

permission.h 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. public:
  38. const TQString getName() const;
  39. const TQString getAccelName() const;
  40. const int type() const;
  41. bool checkError();
  42. void drawInterface( TQWidget* w, TQVBoxLayout* l );
  43. void fillStructure();
  44. TQString processFile( BatchRenamer* b, int, TQString token, int );
  45. void finished();
  46. const TQPixmap getIcon() const;
  47. private:
  48. int getPermissions();
  49. int getGid( TQString group );
  50. int getUid( TQString owner );
  51. struct pervals {
  52. bool changePermissions;
  53. bool changeOwner;
  54. TQString owner; // name of owner
  55. TQString group; // name of group
  56. int newPermission; // Permissions
  57. }perm;
  58. private slots:
  59. void enableControls();
  60. protected:
  61. TQGroupBox* groupPermission;
  62. TQGroupBox* groupOwner;
  63. TQCheckBox* checkPermissions;
  64. TQCheckBox* checkOwner;
  65. TQCheckBox* permBox[3][4];
  66. KComboBox* username;
  67. KComboBox* groupname;
  68. TQVBoxLayout* groupOwnerLayout;
  69. TQVBoxLayout* Layout0;
  70. TQHBoxLayout* Layout2;
  71. TQHBoxLayout* Layout3;
  72. TQHBoxLayout* Layout4;
  73. };
  74. #endif