/core/externals/update-engine/externals/gdata-objectivec-client/Source/Media/GDataNormalPlayTime.h

http://macfuse.googlecode.com/ · C++ Header · 50 lines · 18 code · 11 blank · 21 comment · 2 complexity · b0fad3c1e8dfa38782614ec7e47b01d3 MD5 · raw file

  1. /* Copyright (c) 2007 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_PHOTOS_SERVICE \
  16. || GDATA_INCLUDE_YOUTUBE_SERVICE
  17. #import <Foundation/Foundation.h>
  18. #import "GDataDefines.h"
  19. // Time specification object which tries to conform to section 3.6
  20. // of RFC 2326 (Normal Play Time). http://www.ietf.org/rfc/rfc2326.txt
  21. //
  22. // It does not support ranges.
  23. //
  24. // It only supports a millisecond precision. Any time more precise than
  25. // that will be lost when parsing.
  26. @interface GDataNormalPlayTime : NSObject {
  27. long long ms_;
  28. BOOL isNow_;
  29. }
  30. + (GDataNormalPlayTime *)normalPlayTimeWithString:(NSString *)str;
  31. - (long long)timeOffsetInMilliseconds; // -1 if "now"
  32. - (void)setTimeOffsetInMilliseconds:(long long)ms;
  33. - (BOOL)isNow;
  34. - (void)setIsNow:(BOOL)isNow;
  35. - (NSString *)HHMMSSString; // hh:mm:ss.fraction or "now"
  36. - (NSString *)secondsString; // seconds.fraction or "now"
  37. - (void)setFromString:(NSString *)str;
  38. @end
  39. #endif // #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_*_SERVICE