00001 #ifndef PARENTALCONTROLS_H_
00002 #define PARENTALCONTROLS_H_
00003
00004 class ParentalLevel
00005 {
00006 public:
00007 enum Level { plNone = 0, plLowest = 1, plLow = 2, plMedium = 3,
00008 plHigh = 4 };
00009
00010 public:
00011 ParentalLevel(Level pl);
00012 explicit ParentalLevel(int pl);
00013 ParentalLevel(const ParentalLevel &rhs);
00014 ParentalLevel &operator=(const ParentalLevel &rhs);
00015 ParentalLevel &operator=(Level pl);
00016
00017 ParentalLevel &operator++();
00018
00019 ParentalLevel &operator+=(int amount);
00020
00021 ParentalLevel &operator--();
00022
00023 ParentalLevel &operator-=(int amount);
00024
00025 Level GetLevel() const;
00026
00027 void reset() { m_hitlimit = false; }
00028 bool good() const { return !m_hitlimit; }
00029
00030 private:
00031 Level m_pl;
00032 bool m_hitlimit;
00033 };
00034
00035 bool operator!=(const ParentalLevel &lhs, const ParentalLevel &rhs);
00036 bool operator==(const ParentalLevel &lhs, const ParentalLevel &rhs);
00037 bool operator<(const ParentalLevel &lhs, const ParentalLevel &rhs);
00038 bool operator>(const ParentalLevel &lhs, const ParentalLevel &rhs);
00039 bool operator<=(const ParentalLevel &lhs, const ParentalLevel &rhs);
00040 bool operator>=(const ParentalLevel &lhs, const ParentalLevel &rhs);
00041
00042 bool checkParentPassword(ParentalLevel::Level to_level,
00043 ParentalLevel::Level current = ParentalLevel::plNone);
00044
00045 #endif // PARENTALCONTROLS_H_