1// Copyright 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_COMMON_MEDIA_GALLERIES_PMP_CONSTANTS_H_
6#define CHROME_COMMON_MEDIA_GALLERIES_PMP_CONSTANTS_H_
7
8#include <string>
9
10#include "base/basictypes.h"
11#include "base/time/time.h"
12
13namespace picasa {
14
15// PMP file format.
16// Info derived from: http://sbktech.blogspot.com/2011/12/picasa-pmp-format.html
17
18const char kPmpExtension[] = "pmp";
19
20const base::Time::Exploded kPmpVariantTimeEpoch = {
21  1899, 12, 7, 30,  // Dec 30, 1899 (Saturday)
22  0, 0, 0, 0        // 00:00:00.000
23};
24
25const int64 kPmpHeaderSize = 20;
26
27const int kPmpMagic1Offset = 0;
28const int kPmpMagic2Offset = 6;
29const int kPmpMagic3Offset = 8;
30const int kPmpMagic4Offset = 14;
31
32const uint32 kPmpMagic1 = 0x3fcccccd;
33const uint16 kPmpMagic2 = 0x1332;
34const uint32 kPmpMagic3 = 0x00000002;
35const uint16 kPmpMagic4 = 0x1332;
36
37const int kPmpFieldType1Offset = 4;
38const int kPmpFieldType2Offset = 12;
39const int kPmpRowCountOffset   = 16;
40
41enum PmpFieldType {
42  PMP_TYPE_STRING   = 0x00,
43  PMP_TYPE_UINT32   = 0x01,
44  PMP_TYPE_DOUBLE64 = 0x02,
45  PMP_TYPE_UINT8    = 0x03,
46  PMP_TYPE_UINT64   = 0x04,
47  PMP_TYPE_INVALID  = 0xff
48};
49
50}  // namespace picasa
51
52#endif  // CHROME_COMMON_MEDIA_GALLERIES_PMP_CONSTANTS_H_
53