1.1 --- a/ornamentedobj.cpp Wed Mar 08 12:59:08 2006 +0000
1.2 +++ b/ornamentedobj.cpp Tue Mar 14 14:27:16 2006 +0000
1.3 @@ -53,13 +53,19 @@
1.4 standardFlags=new FlagRowObj(canvas);
1.5 standardFlags->clone(standardFlagsDefault);
1.6 standardFlags->setName ("standardFlags");
1.7 +
1.8 + hideExport=false;
1.9 +
1.10 + url="";
1.11 + vymLink="";
1.12 +
1.13 }
1.14
1.15 void OrnamentedObj::copy (OrnamentedObj* other)
1.16 {
1.17 LinkableMapObj::copy(other);
1.18 heading->copy(other->heading);
1.19 - setColor (other->heading->getColor(),false);
1.20 + setColor (other->heading->getColor());
1.21
1.22 note.copy (other->note);
1.23 systemFlags->copy (other->systemFlags);
1.24 @@ -67,6 +73,9 @@
1.25
1.26 ornamentsBBox=other->ornamentsBBox;
1.27
1.28 + hideExport=other->hideExport;
1.29 + url=other->url;
1.30 + vymLink=other->vymLink;
1.31 }
1.32
1.33 QString OrnamentedObj::getHeading()
1.34 @@ -82,6 +91,12 @@
1.35 LinkableMapObj::setLinkColor (mapEditor->getDefLinkColor());
1.36 }
1.37
1.38 +void OrnamentedObj::setColor (QColor col)
1.39 +{
1.40 + heading->setColor(col);
1.41 + setLinkColor();
1.42 +}
1.43 +
1.44 QColor OrnamentedObj::getColor ()
1.45 {
1.46 return heading->getColor();
1.47 @@ -195,6 +210,59 @@
1.48 return note.getNoteOpenDoc();
1.49 }
1.50
1.51 +void OrnamentedObj::setURL(QString s)
1.52 +{
1.53 + url=s;
1.54 + if (!url.isEmpty())
1.55 + systemFlags->activate("url");
1.56 + else
1.57 + systemFlags->deactivate("url");
1.58 + calcBBoxSize(); // recalculate bbox
1.59 + positionBBox(); // rearrange contents
1.60 + forceReposition();
1.61 +}
1.62 +
1.63 +QString OrnamentedObj::getURL()
1.64 +{
1.65 + return url;
1.66 +}
1.67 +
1.68 +void OrnamentedObj::setVymLink(QString s)
1.69 +{
1.70 + if (!s.isEmpty())
1.71 + {
1.72 + // We need the relative (from loading)
1.73 + // or absolute path (from User event)
1.74 + // and build the absolute path.
1.75 + // Note: If we have relative, use path of
1.76 + // current map to build absolute path
1.77 + QDir d(s);
1.78 + if (!d.path().startsWith ("/"))
1.79 + {
1.80 + QString p=mapEditor->getDestPath();
1.81 + int i=p.findRev("/",-1);
1.82 + d.setPath(p.left(i)+"/"+s);
1.83 + d.convertToAbs();
1.84 + }
1.85 + vymLink=d.path();
1.86 + systemFlags->activate("vymLink");
1.87 + }
1.88 + else
1.89 + {
1.90 + systemFlags->deactivate("vymLink");
1.91 + vymLink="";
1.92 + }
1.93 + calcBBoxSize(); // recalculate bbox
1.94 + positionBBox(); // rearrange contents
1.95 + forceReposition();
1.96 +}
1.97 +
1.98 +QString OrnamentedObj::getVymLink()
1.99 +{
1.100 + return vymLink;
1.101 +}
1.102 +
1.103 +
1.104 void OrnamentedObj::toggleStandardFlag(QString f, bool exclusive)
1.105 {
1.106 standardFlags->toggle(f,exclusive);
1.107 @@ -239,3 +307,46 @@
1.108 }
1.109 }
1.110
1.111 +void OrnamentedObj::setHideInExport(bool b)
1.112 +{
1.113 + hideExport=b;
1.114 + if (b)
1.115 + systemFlags->activate("hideInExport");
1.116 + else
1.117 + systemFlags->deactivate("hideInExport");
1.118 + calcBBoxSize();
1.119 + positionBBox();
1.120 + requestReposition();
1.121 +}
1.122 +
1.123 +bool OrnamentedObj::hideInExport()
1.124 +{
1.125 + return hideExport;
1.126 +}
1.127 +
1.128 +QString OrnamentedObj::getOrnAttr()
1.129 +{
1.130 + QString posAttr;
1.131 + if (depth==0 || depth==1) posAttr=
1.132 + attribut("absPosX",QString().setNum(absPos.x(),10)) +
1.133 + attribut("absPosY",QString().setNum(absPos.y(),10));
1.134 + else
1.135 + posAttr="";
1.136 +
1.137 + QString urlAttr;
1.138 + if (!url.isEmpty())
1.139 + urlAttr=attribut ("url",url);
1.140 +
1.141 + QString vymLinkAttr;
1.142 + if (!vymLink.isEmpty())
1.143 + vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) );
1.144 +
1.145 + QString hideExpAttr;
1.146 + if (hideExport)
1.147 + hideExpAttr= attribut("hideInExport","true");
1.148 + else
1.149 + hideExpAttr="";
1.150 +
1.151 + return posAttr +urlAttr +vymLinkAttr +getLinkAttr() +hideExpAttr;
1.152 +}
1.153 +